cran

List exported objects from R package without attaching it

痴心易碎 提交于 2019-12-08 16:39:28
问题 Is there a way to list the objects that a package exports, without actually attaching it? I tried ls(loadNamespace("ggplot2")) However this shows all of the defined and imported objects in this package. Instead I would like to see only the exported names. I.e. I would like the result of library(ggplot2) ls("package:ggplot2") But without actually attaching the package to my search path. 回答1: You could use documented getNamespaceExports("ggplot2") . 回答2: Ah found it. The undocumented ls

Warning “downloaded length != reported length” in installing packages from CRAN

若如初见. 提交于 2019-12-08 14:28:08
问题 Searching on stackoverflow questions, I found out this link: Error in file.download when downloading custom file . However, my case is a little bit different (I think): 1) I get this annoying warning when installing some packages from CRAN (or also just some dependencies that get generally installed together with the required package). 2) The downloaded length always appear to be equal to the reported length, so there should be no warning. As an example, I copy-paste here the warning that has

Unsupported URL scheme error, how to use “https” CRAN mirrors in R 3.2.4?

纵然是瞬间 提交于 2019-12-07 18:56:36
问题 When I run install.packages("packagename") I get prompted to choose a CRAN mirror. If I choose a https mirror the following error message comes up: unsupported URL scheme If I choose a http mirror (choice 22), installation goes on without this warning. How do I make install.packages() support https mirrors? I'm using a 32 bit version of R if that is of any importance. 回答1: Try this: install.packages("packagename", repos="http://cran.cnr.berkeley.edu") 来源: https://stackoverflow.com/questions

R语言 包

落花浮王杯 提交于 2019-12-06 10:01:17
R语言包 R语言的包是R函数,编译代码和样本数据的集合。 它们存储在R语言环境中名为“library”的目录下。 默认情况下,R语言在安装期间安装一组软件包。 随后添加更多包,当它们用于某些特定目的时。 当我们启动R语言控制台时,默认情况下只有默认包可用。 已经安装的其他软件包必须显式加载以供将要使用它们的R语言程序使用。 所有可用的R语言包都列在R语言的包。 下面是用于检查,验证和使用R包的命令列表。 检查可用R语言的包 获取包含R包的库位置 .libPaths() 当我们执行上面的代码,它产生以下结果。 它可能会根据您的电脑的本地设置而有所不同。 [2] "C:/Program Files/R/R-3.2.2/library" 获取已安装的所有软件包列表 library() 当我们执行上面的代码,它产生以下结果。 它可能会根据您的电脑的本地设置而有所不同。 Packages in library ‘C:/Program Files/R/R-3.2.2/library’: base The R Base Package boot Bootstrap Functions (Originally by Angelo Canty for S) class Functions for Classification cluster "Finding Groups in Data":

NOTE in R CRAN check ---No repository set, so cyclic dependency check skipped [duplicate]

北慕城南 提交于 2019-12-05 17:39:19
问题 This question already has answers here : NOTE in R CRAN Check: No repository set, so cyclic dependency check skipped (2 answers) Closed 4 years ago . I have read NOTE in R CRAN Check: No repository set, so cyclic dependency check skipped and to the best of my knowledge followed the suggestions. Specifically I have an .Rprofile file in ~/ with the line options(repos = c(CRAN=\"http://cran.r-project.org\") . I ran the bash script at the bottom of the page and still have two notes instead of the

Possible to state explicit versions of package dependencies?

浪子不回头ぞ 提交于 2019-12-05 05:25:20
I tend to be rather explicit than implicit about the code I write. So after having managed to create my own packages, the next thing that immediately comes to my mind is how best to ensure robustness and reliability of my code. Part of that has to do with the packages my package depends on. Actual Question In that respect: is it possible to explicitly state which version of a package dependency is required/desired? I'm looking for ways that don't require stating the actual path to, say, the zip file (which of course would easily be possible), but just make use of install.packages "standard

Trouble installing RJSONIO library

只愿长相守 提交于 2019-12-05 04:09:02
问题 I'm having some trouble installing RJSONIO. install.packages tells me that the package is not available for my version of R. I can manually download the binary and install, but then I can't use the library because it is "not installed for 'arch=x64'" workarounds? > install.packages('RJSONIO') Installing package(s) into ‘C:/R/site-library’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘RJSONIO’ is not available (for R version 2.13.0) > > install.packages( "C:\\downloads\

R package dependencies

一曲冷凌霜 提交于 2019-12-05 00:42:00
i'm trying to build a R package, but it seems that there are some problems with the package dependencies. If I run the code in R, I need the packages "rgdal" and "rgeos", so for creatng the package out of it, I: Added the line "import(rgdal, rgeos)" to the NAMESPACE file Added the line "Depends: rgeos, rgdal" to the DESCRIPTION file When I run R CMD check (after build) I got an error which says: * checking package dependencies ... ERROR Benötigte, aber nicht verfügbare Pakete: 'rgeos' 'rgdal' See the information on DESCRIPTION files in the chapter 'Creating R packages' of the 'Writing R

How to create CRAN ready R package that have external dependencies (libxml2)

旧街凉风 提交于 2019-12-04 19:12:19
I have created an R package that I would like to submit to CRAN. It contains code that needs to be compiled (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 needed binary dependencies. When reading the CRAN guidelines I see that only source packages may be uploaded and that they may not contain any binary files. My questions are then: Is it ok for Mac/Linux to have the user

Unloading rJava and/or restarting JVM

可紊 提交于 2019-12-04 18:41:51
问题 I would like to use rJava in combination with mcparallel but obviously the JVM cannot be forked. Therefore a separate JVM instance needs to be initiated for each child process, e.g: library(rJava) library(parallel) myfile <- system.file("tests", "test_import.xlsx", package = "xlsx") #This works: mccollect(mcparallel({ #Automatically initiates JVM in child xlsx::read.xlsx(myfile, 1) })) However the problem in my case is that the JVM has already been initiated in the (main) parent process as