Nepalwildlife package brings together a list of wild animals and plants found in Nepal. It contains 1 tibble named nepal_wildlife
.
You can install the released version of Nepalwildlife from Github with:
install.packages("devtools")
devtools::install("abhinabkadel/Nepalwildlife")
How many species fall under different taxonomic groups in Nepal? Let’s solve it using the dataset:
library(Nepalwildlife)
library(tidyverse)
nepal_wildlife %>%
count (`Taxonomic Group`)
#> # A tibble: 8 x 2
#> `Taxonomic Group` n
#> <chr> <int>
#> 1 Amphibians 58
#> 2 Birds 852
#> 3 Butterflies 26
#> 4 Conifers 23
#> 5 Mammals 217
#> 6 Reptiles 44
#> 7 Sphingid moths 174
#> 8 Turtles (non-marine) 15
library(devtools)
create_package(pathname/Nepalwildlife)
. This created a folder named Nepalwildlife with skeleton for the package contents such as DESCRIPTION and an R project file.library(usethis)
use_data_raw()
nepal_wildlife.R
in the folder, which converts the csv to a tibble in the .R file.
usethis::use_data()
at the bottom of this R script to create a .rda data object in the data folder"nepal_wildlife"
@export
tag because I am not creating any function and it was advised in class not to do so.document()
use_testthat()
to create a tests folder in the root directoryuse_test("nepal_wildlife")
creates an R file with my tests in it.expect_
statements to check if:
test()
usethis::use_mit_license("Abhinab Kadel")
use_package()
. The following packages are listed under the @import option:
use_readme_rmd( )
and build it using build_readme( )
.use_vignette("nepal_wildlife")
and build it using build_vignette()
.Nepalwildlife
usethis::use_code_of_conduct()
to create a code of conduct text. Then, paste it to the README file (see below)use_news_md()
usethis::use_version()
and select minor increment to set the package version to 0.1.0
usethis::use_pkgdown()
pkgdown::build_site()
Please note that the Nepalwildlife project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.