r-package

reexporting datasets in r packages

元气小坏坏 提交于 2020-03-03 04:28:21
问题 In R packages, there is a possibility of reexporting functions. This makes it easy to recycle the same function without having to repeat the code across different packages. For example, devtools::session_info function is a reexport of sessioninfo::session_info : #' @export #' @importFrom sessioninfo session_info sessioninfo::session_info I am wondering if a similar thing is also possible for datasets. I have two different packages and I am using the same datasets in both packages. This is not

reexporting datasets in r packages

﹥>﹥吖頭↗ 提交于 2020-03-03 04:18:50
问题 In R packages, there is a possibility of reexporting functions. This makes it easy to recycle the same function without having to repeat the code across different packages. For example, devtools::session_info function is a reexport of sessioninfo::session_info : #' @export #' @importFrom sessioninfo session_info sessioninfo::session_info I am wondering if a similar thing is also possible for datasets. I have two different packages and I am using the same datasets in both packages. This is not

reexporting datasets in r packages

谁说我不能喝 提交于 2020-03-03 04:17:11
问题 In R packages, there is a possibility of reexporting functions. This makes it easy to recycle the same function without having to repeat the code across different packages. For example, devtools::session_info function is a reexport of sessioninfo::session_info : #' @export #' @importFrom sessioninfo session_info sessioninfo::session_info I am wondering if a similar thing is also possible for datasets. I have two different packages and I am using the same datasets in both packages. This is not

How to convert object of Transaction to Dataframe in R

99封情书 提交于 2020-02-28 18:45:26
问题 How to convert the Dataset(Groceries) in arules package to dataframe. class(Groceries) [1] "transactions" attr(,"package") [1] "arules" 回答1: You need to specify what is actually needed. I don't see an as.data.frame.transactions function in the help page for the arules -package. The data-item Groceries does have a dataframe embedded in it but whether that is what you want seems unlikely: str(Groceries) Formal class 'transactions' [package "arules"] with 3 slots ..@ data :Formal class

Unable to build inline segments in RSiteCatalyst package in R

↘锁芯ラ 提交于 2020-02-07 12:19:25
问题 I am trying to build the inline segment to filter the pages (ex. to separate the pages for blogs and games) using the function BuildClassificationValueSegment() to get the data from Adobe Analytics API, I have tried some thing like report.data.visits <- QueueTrended(reportsuite.id,date.from,date.to,metrics,elements, segment.inline = BuildClassificationValueSegment("evar2","blog","OR")). Got error like : Error in ApiRequest(body = report.description, func.name = "Report.Validate") : ERROR:

import all the functions of a package except one when building a package

老子叫甜甜 提交于 2020-01-23 01:14:27
问题 I'm building an R package ( mypackage ) that imports data.table and another package (let's call it myotherpackage ). Imports: data.table, myotherpackage is in the DESCRIPTION file of mypackage . myotherpackage imports dplyr, which has several functions named like the data.table functions, so I get warnings like this everytime I load mypackage : Warning: replacing previous import ‘data.table::first’ by ‘dplyr::first’ when loading ‘mypackage’ Is there a way to import all the functions of data

R package building error

半世苍凉 提交于 2020-01-17 07:18:06
问题 I am trying to build an R package. I usually run the clean and rebuild command in Rstudio. I am now getting this error message: ==> devtools::document(roclets=c('rd', 'collate', 'namespace', 'vignette')) Updating ED2io documentation Loading ED2io Deleting grapes-equals-grapes.Rd Writing NAMESPACE Documentation completed ==> R CMD INSTALL --preclean --no-multiarch --with-keep.source EDio * installing to library ‘/opt/local/Library/Frameworks/R.framework/Versions/3.3/Resources/library’ *

using `XPtr` to create pointer to a user defined function in Rcpp

耗尽温柔 提交于 2020-01-16 09:59:07
问题 --------- Adding a summary of the problem --------------------------------- I want to create a externalpointer for a user defined function which can be passed to the another function. The user will provide function name as a string, my question is how can I convert that into a function pointer, after checking that the user provided string (say fstr ) matches with the name of the function that was created by the user, i.e. if (fstr == "<USER_DEFINED_FUNCTION_NAME>") XPtr<funcPtr> fun(new

How directly access S3 method in roxygen2 R package

落花浮王杯 提交于 2020-01-16 00:47:13
问题 I'm writing my first package with roxygen2 . The package implements a faster version of pcdtest() from plm package. Thus I call within my package: merr <- resid(mod) Package plm implements a S3 method for resid. It exports it in plm 's NAMESPACE this way: S3method("residuals", "panelmodel") S3method("residuals", "plm") To be able to use resid() , I import whole plm package via #' @import plm Is there any way to access the proper method directly via :: ? Or to import just the method? Or other

How to create CRAN ready R package that has external dependency libxml2

橙三吉。 提交于 2020-01-13 05:13:48
问题 I have created an R package that I would like to submit to CRAN. It contains code that needs to be compiled in plain C and this code depends on the libxml2 library. My current solution is to let Linux and Mac users install the libxml2-dev package, which lets them compile and install the R source package. For Windows, I have created a special binary R-package that contains the required binary dependency. When reading the CRAN guidelines I see that only source packages may be uploaded and that