Casting Values into Shape

Helper functions with a consistent interface to coerce and verify the types and shapes of values for input checking.


Travis buildstatusCoveragestatusAppVeyorbuildstatus

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.

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("forge")

0.1.0 by Kevin Kuo, 3 months ago


Browse source code at https://github.com/cran/forge


Authors: Kevin Kuo [aut, cre]


Documentation:   PDF Manual  


Apache License (>= 2.0) license


Imports rlang

Suggests testthat, covr


Imported by graphframes, mlflow, sparklyr, tfestimators.


See at CRAN