forge: Casting values into shape
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
R
man
tests
.Rbuildignore
.gitignore
.travis.yml
DESCRIPTION
LICENSE.md
NAMESPACE
README.Rmd
README.md
appveyor.yml
codecov.yml
cran-comments.md
forge.Rproj

README.md

Travis build statusCoverage statusAppVeyor build status

forge

forge provides a set of helper functions for input checking and casting. It is intended to be used by package developers to interoperate with other language runtimes, such as Python and JVM languages.

Installation

You can install forge from CRAN with

install.packages("forge")

You can install the development version from GitHub with

devtools::install_github("rstudio/forge")

Examples

library(sparklyr)
sc <- spark_connect(master = "local")

spark_vector <- function(sc, x) {
  v <- forge::cast_double_list(x)
  invoke_new(sc, "org.apache.spark.ml.linalg.DenseVector", v)
}

spark_vector(sc, 1:3)
#> <jobj[14]>
#>   org.apache.spark.ml.linalg.DenseVector
#>   [1.0,2.0,3.0]

Please note that the ‘forge’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.