devtools

How to create an R package nested in git directory

耗尽温柔 提交于 2019-12-11 07:20:08
问题 I used to be able to build my R packages within my github repo, but the devtools functions have been deprecated and replaced with new functions that won't allow me to do this anymore. I was previously using devtools::setup('NewPackage', check=FALSE) in my directory /home/User/NewPackage/ , to create my R package /home/User/NewPackage/NewPackage The new alternative gives the following error usethis::create_package('NewPackage') #New project 'NewPackage' is nested inside an existing project '

Package dependency error “there is no package called ‘stringi’”

谁都会走 提交于 2019-12-11 05:08:13
问题 I created an R package and loaded it to github (microdadosBrasil). When I try to install the package (as a user would) I get the following error: devtools::install_github("lucasmation/microdadosBrasil") Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘stringi’ I tried solving this by adding stringi to the package dependencies In DESCRIPTION in included: Imports: stringi I also included the package import at NAMESPACE import(stringi) But,

How can I automatically add/update Depends/Imports/Suggests versions in DESCRIPTION?

≯℡__Kan透↙ 提交于 2019-12-11 05:06:17
问题 I like to keep my R packages up to date, and in developing my own package, I want to stick to @Hadley's advice: Generally, it’s always better to specify the version and to be conservative about which version to require. Unless you know otherwise, always require a version greater than or equal to the version you’re currently using. So, I'll need some of those here in DESCRIPTION : Imports: knitr (>= 1.13), rmarkdown (>= 1.0) Is there an existing tool to programmatically update the versions of

R: Added import(data.table) to NAMESPACE automatically using devtools

ⅰ亾dé卋堺 提交于 2019-12-11 03:26:23
问题 How do I correctly add import(data.table) to the NAMESPACE file automatically using devtools ? Generally if my packages use data.table I just write it in manually, but then I can't use @export and devtools::document to create the NAMESPACE file properly, as it either overwrites the addition I've made, or doesn't update the file at all. Plus, it says not edit it manually... Thanks Sample package/R/function.R code #' @export #' @import data.table test_data_table = function(dt) { dt[, a := 3] }

having trouble getting devtools::install_github() to work in R on Win 7 64bit machine

好久不见. 提交于 2019-12-11 02:48:01
问题 each time I try to run install_github() from RStudio I get something like this: devtools::install_github("r-lib/devtools") Downloading GitHub repo r-lib/devtools@master Error in utils::download.file(url, path, method = download_method(), quiet = quiet, : cannot open URL 'https://api.github.com/repos/r-lib/devtools/tarball/master'* I tried the work around described in https://github.com/r-lib/devtools/issues/1772 and this is what I get: assignInNamespace("version_info", c(devtools::version

“Uncaught Error: Received packet in the wrong sequence” with devtools off - Electron + MySQL node driver + Webpack

喜你入骨 提交于 2019-12-11 02:17:04
问题 When I set up a new project using Electron + Webpack + node MySQL my production build is throwing: Uncaught Error: Received packet in the wrong sequence The error goes away only if I keep: config.devtools = 'eval' in my production builds, apparently this will result in a larger file size and some performance issues which I would like to avoid. Why my project / mysql module crashes with devtools set to '' ?? I can hardly find similar reports, am I the only one having this issue? webpack.config

best way to link to a vignette from manual in an R package

為{幸葍}努か 提交于 2019-12-10 18:22:26
问题 I'm developing an R package, and I'm trying to make a link from the manual of the package to its vignette (a pdf). I've make this in the R function code, and it works: \link[=../doc/package.pdf]{package's User Manual} The problem is that the devtools::check() complains with a warning, which also causes a delay in the process of revision when uploading to CRAN... * checking Rd cross-references ... WARNING Missing link or links in documentation object 'package.Rd': '../doc/package.pdf' Is there

R package: writing internal data, but not all at once

早过忘川 提交于 2019-12-10 16:01:33
问题 I'm working on an R package using usethis / devtools . The package has a few objects I'd like to keep internal, just to keep down the clutter. The structure I was using was to make objects in different files based on their source, all in my data-raw folder. For instance, the file make_laus_codes.R preps two data frames of lookup codes from the Bureau of Labor Statistics (one internal, called laus_codes ), and the file make_decennial_tables.R preps lookup codes from the Decennial Census

unable to install R-package from github

江枫思渺然 提交于 2019-12-10 15:37:15
问题 I'm trying to install a flowIncubator package from github (link to the package: https://github.com/RGLab/flowIncubator). I'm using R version 3.3.1 (2016-06-21). I've tried this code: devtools::install_github("RGLab/flowIncubator") & get this error: Error in curl::curl_fetch_disk(url, x$path, handle = handle) : Timeout was reached > traceback() 12: .Call(R_curl_fetch_disk, url, handle, path, "wb", nonblocking) 11: curl::curl_fetch_disk(url, x$path, handle = handle) 10: request_fetch.write_disk

Build .md vignette using devtools

ε祈祈猫儿з 提交于 2019-12-10 14:22:42
问题 I’m using knitr::rmarkdown (but knitr::knitr does the same) as my VignetteEngine . I then build my package vignette using devtools::build_vignettes() . This works, but only creates HTML and R output files in inst/doc . What I want is a Markdown output file, since only that can be displayed directly within the Github project pages (for HTML files, Github shows the source and for Rmd files it shows a rendered output but — obviously — without executing the R blocks). I’ve tried finding out how