devtools

do not show function help document in building R package by roxygen2

你离开我真会死。 提交于 2019-12-04 16:33:26
问题 I am using devtools to build R package, and there are some functions that are NOT designed to be visible to end-users. However, since these functions involve calling C codes by .Call , so that I have to write @useDynLib above the function for automatic generation of .Rd files. In that way, when I build the package, even I did NOT include the @export for those functions, they nonetheless appear in the help document... Is there a way to suppress those functions even if they have been documented

r sourcing private repos from github

一个人想着一个人 提交于 2019-12-04 10:14:39
Hi I was wondering how to source private repos in github that I have been given access to. Using the devtools package, it is easy enough to source open repos by using commands such as: source_url('https://raw.github.com/hadley/stringr/master/R/c.r') but doing the equivalent with the URL for a private repo doesn't seem to work. P.S. I know I can clone the whole repo, and then get the file that way, but I'm looking for just one specific file in the whole repo to take, and it's a bit inefficient to clone the whole thing, copy the code and the use it as necessary. I'm not really familiar with R,

C++ function not available

旧街凉风 提交于 2019-12-04 05:58:20
I have the following file cumsum_bounded.cpp #include <Rcpp.h> using namespace Rcpp; //' Cumulative sum. //' @param x numeric vector //' @param low lower bound //' @param high upper bound //' @param res bounded numeric vector //' @export //' @return bounded numeric vector // [[Rcpp::export]] NumericVector cumsum_bounded(NumericVector x, double low, double high) { NumericVector res(x.size()); double acc = 0; for (int i=0; i < x.size(); ++i) { acc += x[i]; if (acc < low) acc = low; else if (acc > high) acc = high; res[i] = acc; } return res; } I then Build & Reload and test out my new function.

installation of package ‘devtools’ had non-zero exit status in a powerpc

狂风中的少年 提交于 2019-12-04 02:47:32
I'm trying to install devtools in a PowerPC with a R version 3.1.1 but failed at the end because the curl library: ... ** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/path to/R/powerpc-unknown-linux-gnu-library/3.1/curl/libs/curl.so': /path to/R/powerpc-unknown-linux-gnu-library/3.1/curl/libs/curl.so: undefined symbol: BSWAP_32 Error: loading failed Execution halted ERROR: loading failed * removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/curl’ ERROR: dependency ‘curl’ is not available for package ‘httr’ *

data.table throws “object not found” error [duplicate]

点点圈 提交于 2019-12-03 23:42:21
This question already has an answer here : Closed 5 years ago . R data.table breaks in exported functions (1 answer) I have a data.table: library(data.table) mydt <- data.table(index = 1:10) I am getting this to work when I try it in the global environment, but not when I am in the debugger or when I use it in a package test. The problem is that I can not subset it in the standard ways. Browse[2]> mydt[,index] Error in `[.data.frame`(x, i, j) : object 'index' not found Browse[2]> mydt[,list(index)] Error in `[.data.frame`(x, i, j) : object 'index' not found Here is a reproducible example, in

Package development : location of pdf manual and vignette

扶醉桌前 提交于 2019-12-03 14:39:18
When building mypackage, everything seems to work: library(devtools) build(vignettes = T, manual = T) * checking for file ‘/storage/Documents/client/validate/mypackage/DESCRIPTION’ ... OK * preparing ‘mypackage’: * checking DESCRIPTION meta-information ... OK * installing the package to build vignettes * creating vignettes ... OK * checking for LF line-endings in source and make files * checking for empty or unneeded directories * building ‘mypackage_0.1.tar.gz’ [1] "/storage/Documents/client/validate/mypackage_0.1.tar.gz" However I can't find neither the PDF manual nor the vignette. Vignette:

do not show function help document in building R package by roxygen2

泄露秘密 提交于 2019-12-03 11:24:23
I am using devtools to build R package, and there are some functions that are NOT designed to be visible to end-users. However, since these functions involve calling C codes by .Call , so that I have to write @useDynLib above the function for automatic generation of .Rd files. In that way, when I build the package, even I did NOT include the @export for those functions, they nonetheless appear in the help document... Is there a way to suppress those functions even if they have been documented? Thanks! alittleboy According to Hadley's comments, use @keywords internal will make the function

Build & Reload in RStudio on Windows: devtools::document() says devtools not found

僤鯓⒐⒋嵵緔 提交于 2019-12-03 06:06:30
When I click "Build & Reload" on the Build tab within RStudio, I get the following error: ==> devtools::document(roclets=c('rd', 'collate', 'namespace')) Error in loadNamespace(name) : there is no package called 'devtools' Calls: suppressPackageStartupMessages ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted Exited with status 1. But when I just enter devtools::document(roclets=c('rd', 'collate', 'namespace')) directly into the console, it works. In addition, if I uncheck "Build & Reload" under "Automatically roxygenize when running:" in the Build Tools -> Roxygen

R: source_gist not working

纵饮孤独 提交于 2019-12-03 05:42:55
I am trying to use source_gist from the devtools package but I am encountering an error: > library(devtools) > source_gist("524eade46135f6348140") Error in r_files[[which]] : invalid subscript type 'closure' Thanks for any advice. Agree this is a bug, which I see you've submitted . A temporary workaround is to specify the filename option: devtools::source_gist("524eade46135f6348140", filename = "ggplot_smooth_func.R") 来源: https://stackoverflow.com/questions/38345894/r-source-gist-not-working

Is Git ready to be recommended to my boss? [closed]

≡放荡痞女 提交于 2019-12-03 04:16:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I want to recomment Git to my boss as a new source control system, since we're stuck in the 90s with VSS (ouch), but are the tools and 3rd party support good enough yet? Specifically I'm talking about GUI front-ends similar to TortoiseSVN, decent visual diff/merge support, as well as stuff like email commit