我的R包使用内部变量x.如果我加载包(我只尝试使用devtools::load_all),然后x没有出现在ls()列表中,但它确实有一个值.我怎么能避免这个?
我很好,用户可以使用myPackage::x但不是简单地访问变量x.
我正在使用devtools构建我的R包,并使用该函数check来检查包(在屏幕上有一长串输出).但是,因为我的软件包包含示例,并且一些示例非常耗时,我想知道在检查软件包时如何禁止检查示例devtools.该check功能本身似乎没有这样的选项.谢谢!
inst/extdata正如Jan所建议的那样,现在在dfunbindpackage中实现了按列存储在package目录中。
我正在使用这种data-raw惯用法来使从原始数据到结果的整个分析都可重现。为此,数据集首先包装在R包中,然后可以使用加载library()。
我使用的数据集之一比较庞大,大约有800万个观测值,其中包含约80个属性。对于当前的分析,我只需要一小部分属性,但是无论如何我都希望打包整个数据集。
现在,如果将其简单地打包为数据帧(例如,使用devtools::use_data()),则在首次访问它时将全部加载。打包此类数据以使我可以在列级别进行延迟加载的最佳方法是什么?(只有我实际访问的那些列被加载,其他列愉快地保留在磁盘上并且不占用RAM。)ff程序包对您有帮助吗?谁能指出我的工作范例?
我是R和RStudio的新手,但他正在努力学习并整理一个ShinyApps应用程序.我无法通过Shinyapps进程的第1步,即在RStudio中安装devtools包.我认为根本原因是没有安装"xml2"软件包依赖项,但我似乎无法解决这个问题而且我不明白该怎么做.
我在戴尔笔记本电脑上使用Linux Mint Cinnamon 17.1.我从软件管理器安装了RStudio.在试图解决devtools安装过程中的错误,我已经尝试使用安装R和RStudio从稍微更新包下载apt-get的,我已经尝试安装xml2和rversions从RStudio(不可用),我试着用单引号和双引用,我已经尝试添加dependency=true到所有RStudio安装尝试,我已经多次重启RStudio和机器......我没有想法......帮助?
以下是RStudio中devtools安装命令的输出,加上"版本"的输出以防万一.
install.packages("devtools")
Installing package into ‘/home/[MyHomeDir]>/R/i686-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘xml2’ is not available
also installing the dependency ‘rversions’
trying URL 'http://cran.rstudio.com/src/contrib/rversions_1.0.1.tar.gz'
Content type 'application/x-gzip' length 4624 bytes
opened URL
==================================================
downloaded 4624 bytes
trying URL 'http://cran.rstudio.com/src/contrib/devtools_1.8.0.tar.gz'
Content type 'application/x-gzip' length 141487 bytes (138 Kb)
opened URL
==================================================
downloaded 138 Kb
ERROR: dependency ‘xml2’ is not available for package ‘rversions’
* removing ‘/home/[MyHomeDir]/R/i686-pc-linux-gnu-library/3.0/rversions’
Warning …Run Code Online (Sandbox Code Playgroud) 当我尝试使用devtools从git-hub下载并安装软件包时,我遇到了这个问题.
R版本:3.1.3(64位)
> install_github("hadley/httr")
Downloading github repo hadley/httr@master
Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached
> traceback()
13: .Call(R_curl_fetch_memory, url, handle)
12: curl::curl_fetch_memory(url, handle = handle)
11: request_fetch.write_memory(req$output, req$url, handle)
10: request_fetch(req$output, req$url, handle)
9: request_perform(req, hu$handle$handle)
8: httr::HEAD(src_submodules, , auth)
7: github_has_remotes(x, auth)
6: remote_download.github_remote(remote, quiet = quiet)
5: remote_download(remote, quiet = quiet)
4: FUN(X[[1L]], ...)
3: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
2: install_remotes(remotes, ...)
1: install_github("hadley/httr")
Run Code Online (Sandbox Code Playgroud)
编辑:
我正在使用Revolution R Enterprise 7.4和Rstudio客户端.
我有一个带有辅助功能的个人R包,可在各种项目中使用。但是,我想让一个项目使用该项目的特定版本,然后继续添加代码。我知道我可以用分支来做到这一点,但我更喜欢用提交标签来做到这一点。
查看文档,devtools::install_git似乎如果我标记了一个提交,那么我应该能够安装该特定的提交,但这对我不起作用。
但是尝试安装它给了我这个:
devtools::install_git(url = 'http://<username>@<company stash url>/scm/preamp.git', branch = 'v0.0.1')
# > Downloading git repo http://<username>@<company stash url>/scm/preamp.git
# > Error in .local(object, ...) : 'v0.0.1' did not match any branch
Run Code Online (Sandbox Code Playgroud)
我的R会话信息:
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.1 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel splines stats graphics grDevices utils datasets methods base
other attached packages:
[1] tidyr_0.5.1 lazyeval_0.2.0 assertthat_0.1
[4] beepr_1.2 preamp_0.1 stringr_1.0.0 …Run Code Online (Sandbox Code Playgroud) 我在RStudio&的帮助下制作了一个devtools用于命名空间的包,在手册页中创建了Description&Roxygen2。这很好用,我最近添加的帮助页面也起作用。我决定添加作者姓名,电子邮件和一些详细信息。最初,通过手动编辑手册页文件(BAD),然后编辑R脚本Roxygen2零件并使用以下命令将更改推送到Rm文件中:document()
但是:当我安装我的软件包时
devtools::install_github('SimonDedman/gbm.auto')
Run Code Online (Sandbox Code Playgroud)
我收到以下警告:
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:35: unknown macro '\item'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:37: unknown macro '\item'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:39: unknown macro '\item'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:41: unknown macro '\item'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:43: unknown macro '\item'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:45: unknown macro '\item'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:47: unknown macro '\item'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:49: unknown macro '\item'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:51: unexpected section header '\value'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:55: unexpected section header '\description'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:65: unexpected section header '\examples'
Warning: /tmp/RtmpNladba/devtools27303e05b1fc/SimonDedman-gbm.auto-dbe3cb0/man/gbm.valuemap.Rd:69: unexpected END_OF_INPUT '
'
Run Code Online (Sandbox Code Playgroud)
这些项目只是简单的@param参数,我没有改变,看起来很好,以前也可以使用。同上的value/ description/ examples参数,这些都是标准的(但可能是下游的问题,一旦上游问题是固定的,这将得到解决)。 …
我在roxygen2图书馆和图书馆工作devtools。构建具有以下结构的软件包:
data1.rda和data2.rda。在/ R文件夹中,我有两个文件,一个文件具有创建的功能(及其说明),另一个文件名为data.R,其中包含每个数据集的信息。
#' Description 1
#'
#' Simple definition
#'
#' @format The \code{data.frame} contains 2 variables:
#' \describe{
#' \item{a}{The first variable.}
#' \item{b}{The second variable.}
#' }
"data1"
Run Code Online (Sandbox Code Playgroud)运行时,roxygen2::roxygenize()我收到以下消息:
第一次使用roxygen2。自动升级... get(name,envir = env)中的错误:找不到对象'data1'。
我一直在寻找类似的问题,但没有答案。有人有建议吗?
我正在尝试安装devtools在我的RStudio中.但是我得到了很多错误:
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR --------------------------- …Run Code Online (Sandbox Code Playgroud) devtools::check()对于我准备提交给CRAN的软件包,我将继续通过R CMD检查(通过)(您可以在此处查看该软件包的结果:
Check: dependencies in R code
Result: NOTE
Namespace in Imports field not imported from: ‘tidyr’
All declared Imports should be used.
Run Code Online (Sandbox Code Playgroud)
该软件包的源代码在GitHub上。我已经删除tidyr了整个软件包中所有提及的内容或其功能,但是该注释仍然存在。有许多的堆栈溢出的问题(即,这和其他资源这一点,但没有似乎适用于这种情况。我怎样才能解决这个笔记?
devtools ×10
r ×10
package ×3
rstudio ×2
dependencies ×1
export ×1
github ×1
namespaces ×1
revolution-r ×1
roxygen2 ×1
shiny ×1
timeout ×1