Now we can edit travis file and for example add the R versions like this: r: - oldrel - release - devel Also to run for both osx and linux go with os: - linux - osx
Then Build and push. it will check all versions and os listed in yml file and even for warnings throews an error as warnings_are_errors: defualt value is true.
There are other options like rhub package which I try here : https://r-hub.github.io/rhub/articles/rhub.html After installing rhub, validate your email by rhub::validate_email(email ="example@a.ca"), (if error retart rstudio) then run rhub::check() # now choose one os also check https://r-hub.github.io/rhub/articles/rhub.html
=========
Now navigate to codecov.io and link the github repo to it.
=====
Testing,
install tester and testthat packages.
then run use_testthat. usethis::use_testthat()
it makes testthat.R and a folder and also adds a suggestion for testthat library to the description file.
we have a message the, ● Call use_test() to initialize a basic test file and open it for editing.
Now we run use_test(name="name_of_the_test_fiel") and it will create a file inside the test/testthat folder and we can edit that and put the code there
We need to make a dataset and the expected output to check the code.
with use_data(nameofthedata, compress= "xz") we can include the data in the package. It will create a folder, data, and the data will be compressed and stored there. the maximun for data size is 5 megabytes. "xz" can reduce a csv file size to 1/14. the "bzip2" compression method is stronger than "xz".the "gzip" is the weakest. Note when data is added to the package, there is a dependency on R versions jigher than 2.10, therefore add Depends: R (>= 2.10) in the description file before the licence.
When writing vignette file, using mark down . you can use CSS code to style the document like this: body{ text-align : justify; line-height: 2em; }
======== to add a help, documentation, file to the package itself, run usethis::use_package_doc(). it will create a dummy R file and after doing devtoos::document(), roxygen will create an .Rd file for the package. When writing the packge document, have a look at this link for more options: https://cran.r-project.org/web/packages/roxygen2/vignettes/rd.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.