Description Usage Arguments Author(s) Examples
A function to tansform R data structure to Python data structure, which based on the reticulate package.
1 | gcdata(x)
|
x |
The R project like data.frame,vector, array etc.. |
Xu Jing
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | have_numpy <- reticulate::py_module_available("numpy")
have_sklearn <- reticulate::py_module_available("sklearn")
if(have_numpy && have_sklearn){
library(gcForest)
req_py()
r_dat <- data.frame('x1'=c(1L,2L,3L),'x2'=c(2L,3L,4L))
py_dat <- gcdata(r_dat)
class(py_dat)
r_vec <- c('a','b','c')
py_vec <- gcdata(r_vec)
class(py_vec)
}else{
print('You should have the Python testing environment!')
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.