Test to see if an RScala package will load properly
scalaDef
function provided in RFirst, install the required packages by:
install.packages("devtools")
library(devtools)
install_github("hadley/devtools") # a newer version
To generate the directory structure of your package, execute in R
devtools::create("myfirstpackage")
Add the line
Imports: rscala
to DEPENDENCIES
.
Make sure to provide a title in each of the R files in the
R
directory. You do this by adding the comments
in the first line of the function as follow:
hello <- function(x) {
#' hello
#' @export
print(paste("hello",x))
}
Also, export the function with the macro #' @export
.
Then, to generate documentation by running the bash
script gen.R
by doing this in a terminal:
./gen.R
The file contains only the line roxygen2::roxygenise()
git push
# install.packages("devtools")
devtools::install_github("luiarthur/testRscalaPackage")
library(testRscalaPackage)
You are ready to use your library
hello("Arthur")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.