cannot INSTALL shinyapps - r

I encountered the following error when trying to install shinyapps on my ubuntu 13.04. Can anyone help? Thanks.
Call:
require(devtools)
devtools::install_github('rstudio/shinyapps')
Error:
Installing github repo(s) rstudio/shinyapps/master from hadley
Installing rstudio/shinyapps.zip from https://github.com/hadley/rstudio/shinyapps/archive/master.zip
Error in writeBin(content(request), bundle) :
can only write vector objects
Session Info:
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=zh_CN.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=zh_CN.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=zh_CN.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] R.oo_1.15.8 R.methodsS3_1.5.2 XML_3.98-1.1 devtools_1.4.1
loaded via a namespace (and not attached):
[1] digest_0.6.3 evaluate_0.5.1 httr_0.2 memoise_0.1 parallel_3.0.2 RCurl_1.95-4.1
[7] stringr_0.6.2 tools_3.0.2 whisker_0.3-2
*trackback() prints the following: *
8: stop("can only write vector objects")
7: writeBin(content(request), bundle)
6: (function (url, name = NULL, subdir = NULL, config = list(),
before_install = NULL, ...)
{
if (is.null(name)) {
name <- basename(url)
}
message("Downloading ", name, " from ", url)
bundle <- file.path(tempdir(), name)
request <- GET(url, config)
stop_for_status(request)
writeBin(content(request), bundle)
on.exit(unlink(bundle), add = TRUE)
install_local_single(bundle, subdir = subdir, before_install = before_install,
...)
})(dots[[1L]][[1L]], dots[[2L]][[1L]], subdir = NULL, config = list(),
before_install = function (bundle, pkg_path)
{
desc <- file.path(pkg_path, "DESCRIPTION")
if (!ends_with_newline(desc))
cat("\n", sep = "", file = desc, append = TRUE)
append_field <- function(name, value) {
if (!is.null(value)) {
cat("Github", name, ":", value, "\n", sep = "",
file = desc, append = TRUE)
}
}
append_field("Repo", repo)
append_field("Username", username)
append_field("Ref", ref)
append_field("SHA1", github_extract_sha1(bundle))
append_field("Pull", pull)
append_field("Subdir", subdir)
append_field("Branch", branch)
append_field("AuthUser", auth_user)
})
5: mapply(install_url_single, url, name, MoreArgs = list(subdir = subdir,
config = config, before_install = before_install, ...))
4: install_url(url, name = paste(repo, ".zip", sep = ""), subdir = subdir,
config = auth, before_install = github_before_install, ...)
3: FUN("shinyapps"[[1L]], ...)
2: vapply(repo, install_github_single, FUN.VALUE = logical(1), username,
ref, pull, subdir, branch, auth_user, password, ...)
1: install_github(repo = "shinyapps", username = "rstudio")

Please have a look at the parameter list of install_github. Your call should be
install_github( repo = "shinyapps", username="rstudio" )
At least for devtools prior to version 1.4.1: https://github.com/hadley/devtools/blob/master/NEWS.md

I think you have another choice. Please download the package from https://github.com/hadley/rstudio/shinyapps/archive/master.zip to your local computer. Then install the package by call install_local(). For example,
install_local("~/Downloads/shinyapps-master.zip").
shinyapps-master.zip is the shinyapps package, and ~/Downloads/ is the path.

shinyapps package has been replaced by rsconnect which can be simply installed through CRAN in the regular way.
https://github.com/rstudio/shinyapps

Related

Looping through data with Rmd input file with flextable results in pandoc version error - but works fine without the loop?

I'm trying to generate lots of word documents with a loop and RMarkdown. I'm using flextable to make the tables with the acceptable formatting for the report. Everything works fine until I try to loop through a dataset. Then I get an error about the pandoc version:
Error in knit_print.flextable(x, ...) : pandoc
version >= 2.0 required for flextable rendering in docx "
However, It looks like I download version 2.1 on January 19th...
pandoc_version()
[1] ‘1.19.2.1’
Not to mention, it runs fine without the loop when I just run it in the rmd file. (I would think it wouldn't run either way if the version wasn't correct).
I also tried sys.setenv()
Sys.setenv("RSTUDIO_PANDOC" = "PATH TO PANDOC BIN")
But still, it works for the Rmd file alone, but I get the same error about the version when I try to loop it. Again, I feel like this wouldn't work in the rmd file if this wasn't correct.
I'm including a reproducible example below. If I can provide any other information please let me know. Thanks!
My loop/R Script
DAT<-dplyr::sample_n(iris, 10)
Sys.setenv("RSTUDIO_PANDOC" = "PATH TO PANDOC BIN")
for (i in 1:nrow(DAT)){
rmarkdown::render(input = "Loop Testing R Markdown.Rmd",
output_format = "word_document",
output_file = paste("Documents", i, ".docx", sep=''),
output_dir = "Documents/")
}
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rmarkdown_1.8 knitr_1.17 bindrcpp_0.2 dplyr_0.7.4
qsurvey_0.0.3 installr_0.19.0
[7] stringr_1.2.0 officer_0.2.1 flextable_0.4.2 pander_0.6.1
kableExtra_0.7.0
loaded via a namespace (and not attached):
[1] zip_1.0.0 Rcpp_0.12.14 bindr_0.1
pillar_1.0.1 compiler_3.4.3
[6] plyr_1.8.4 highr_0.6 R.methodsS3_1.7.1
R.utils_2.6.0 base64enc_0.1-3
[11] tools_3.4.3 digest_0.6.13 uuid_0.1-2 lubridate_1.7.1 jsonlite_1.5
[16] evaluate_0.10.1 tibble_1.4.1 viridisLite_0.2.0 pkgconfig_2.0.1 rlang_0.1.6
[21] shiny_1.0.5 curl_3.1 yaml_2.1.16 httr_1.3.1 xml2_1.1.1
[26] htmlwidgets_0.9 gdtools_0.1.6 hms_0.4.0 DT_0.2 rprojroot_1.3-1
[31] glue_1.2.0 data.table_1.10.4-3 R6_2.2.2 readr_1.1.1 magrittr_1.5
[36] backports_1.1.2 scales_0.5.0 htmltools_0.3.6 assertthat_0.2.0 rvest_0.3.2
[41] xtable_1.8-2 mime_0.5 colorspace_1.3-2 httpuv_1.3.5 stringi_1.1.6
[46] visNetwork_2.0.2 munsell_0.4.3 R.oo_1.21.0
> pandoc_version()
[1] ‘1.19.2.1’
>
The Rmd File to Reference
---
output:
word_document:
reference_docx: mystyles.docx
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r results='asis', include=FALSE}
## Load Packages
library(knitr)
library(rmarkdown)
library(dplyr)
```
```{r results="asis"}
#DAT<-iris # I comment this out when I run the loop, but leave it in when testing the format.
library(pander)
panderOptions('knitr.auto.asis', FALSE)
First_N<-DAT[[i,1]]
Last_N<-DAT[[i,2]]
Name<-c(First_N, " ", Last_N)
Name<-paste(Name, collapse = "")
cat("# ", Name, "\n")
```
## Title of Report Section
```{r, demo1, include=FALSE}
library(pander)
panderOptions('knitr.auto.asis', FALSE)
DemoTbl_1<-matrix(nrow = 2, ncol = 4)
DemoTbl_1[[1,1]]<- "Name:"
DemoTbl_1[[1,2]]<- Name
DemoTbl_1[[1,3]]<- "State:"
DemoTbl_1[[1,4]]<-DAT[[i,3]]
DemoTbl_1[[2,1]]<- "Other Feild Title:"
DemoTbl_1[[2,2]]<-DAT[[i,4]]
DemoTbl_1[[2,4]]<-DAT[[i,5]]
DemoTbl_1[[2,3]]<- "Pther Feild Title"
library("flextable")
library("officer")
myft<-regulartable(as.data.frame(DemoTbl_1))
myft <- bg(myft, bg = "#000000", j=1)
myft <- color(myft, color = "#ffffff", j=1)
myft <- border(myft, border = fp_border(color = "#000000"), part = "all")
myft <- align( myft, align = "center", part = "all" )
myft <- width(myft, width = 1.5, j=1)
myft <- width(myft, width = 3, j=2)
myft <- width(myft, width = 1.5, j=3)
myft <- width(myft, width = 1.25, j=4)
myft<- delete_part(myft, part = "header")
myft <- bg(myft, bg = "#000000", j=3)
myft <- color(myft, color = "#ffffff", j=3)
```
```{r, results='asis', echo=FALSE}
#DemoTbl_1 # This prints fine
myft ## This seems to be giving me the error "uitting from lines 77-78
(Loop_Testing_R_Markdown.Rmd) Error in knit_print.flextable(x, ...) : pandoc
version >= 2.0 required for flextable rendering in docx "
```
**Also - In case it's helpful, here is the traceback: **
Error in knit_print.flextable(x, ...) :
pandoc version >= 2.0 required for flextable rendering in docx
20. stop("pandoc version >= 2.0 required for flextable rendering in docx")
19. knit_print.flextable(x, ...)
18. knit_print(x, ...)
17. withVisible(knit_print(x, ...))
16. fun(x, options = options)
15. value_fun(ev$value, ev$visible)
14. withVisible(value_fun(ev$value, ev$visible))
13 .withCallingHandlers(withVisible(value_fun(ev$value, ev$visible)),
warning = wHandler, error = eHandler, message = mHandler)
12. handle(pv <- withCallingHandlers(withVisible(value_fun(ev$value,
ev$visible)), warning = wHandler, error = eHandler, message = mHandler))
11. evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
debug = debug, last = i == length(out), use_try = stop_on_error !=
2L, keep_warning = keep_warning, keep_message = keep_message,
output_handler = output_handler, include_timing = include_timing)
10. evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
options$include) 0L else 2L, output_handler = knit_handlers(options$render,
options))
9. in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
stop_on_error = if (options$error && options$include) 0L else 2L,
output_handler = knit_handlers(options$render, options)))
8. block_exec(params)
7. call_block(x)
6. process_group.block(group)
5. process_group(group)
4. withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
error = function(e) {
setwd(wd)
cat(res, sep = "\n", file = output %n% "") ...
3. process_file(text, output)
2. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet,
encoding = encoding)
1. rmarkdown::render(input = "Loop Testing R Markdown.Rmd", output_format = "word_document",
output_file = paste("Documents", i, ".docx", sep = ""), output_dir = "Documents/")
You need to create a file .Rprofile at the root of your R project (see ?Startup). In that file add your R instruction to set pandoc path (Sys.setenv("RSTUDIO_PANDOC" = "PATH TO PANDOC BIN")).
rmarkdown::render is using a new R session and your variable is not set when rendering.

Error in rep(" ", len) : invalid 'times' argument

library(OneR)
library(RWeka)
loan_train <- read.csv("loan_train.csv")
loan_test <- read.csv("loan_test.csv")
loan_train <- optbin(loan_train, method = "logreg", na.omit = TRUE)
loan_test <- optbin(loan_test, method = "logreg", na.omit = TRUE)
#Task 1
loan_1R <- OneR(bad_loans ~ ., data = loan_train)
loan_1R
loan_JRip <- JRip(bad_loans ~ ., data = loan_train)
loan_JRip
Need some help with my code. I am able to run everything but for some reason, every time I print loan_1R, it gives me an error. Tried using traceback() but have no idea what it means. My csv file can be in the link below.
https://drive.google.com/file/d/1139FUSXUc_fdzgtKAleo5bGAtjcVGoRC/view?usp=sharing
Error in rep(" ", len) : invalid 'times' argument
In addition: Warning message:
In max(nchar(names(model$rules))) :
no non-missing arguments to max; returning -Inf
> traceback()
3: cat("If ", model$feature, " = ", names(model$rules[iter]), rep(" ",
len), " then ", model$target, " = ", model$rules[[iter]],
"\n", sep = "")
2: print.OneR(x)
1: function (x, ...)
UseMethod("print")(x)
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_Singapore.1252 LC_CTYPE=English_Singapore.1252
[3] LC_MONETARY=English_Singapore.1252 LC_NUMERIC=C
[5] LC_TIME=English_Singapore.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RWeka_0.4-37 OneR_2.2
loaded via a namespace (and not attached):
[1] compiler_3.4.1 tools_3.4.1 grid_3.4.1 rJava_0.9-9 RWekajars_3.9.2-1
After hours of testing i found out the problem but I have no idea why it is so. Think that it has something to do with the library(RWeka) package.... Placing library(RWeka) after the OneR code seemed to make it run. But this means i encounter the error only once i run the library(RWeka). Any workaround this?
library(OneR)
loan_train <- read.csv("loan_train.csv")
loan_test <- read.csv("loan_test.csv")
loan_train <- optbin(loan_train, method = "logreg", na.omit = TRUE)
loan_test <- optbin(loan_test, method = "logreg", na.omit = TRUE)
#Task 1
loan_1R <- OneR(bad_loans ~ ., data = loan_train)
loan_1R
library(RWeka)
loan_JRip <- JRip(bad_loans ~ ., data = loan_train)
loan_JRip

Catch Error/Warning from Install.Packages() - R [duplicate]

Consider the following usage:
tryCatch(log("a"), error = function(e) NULL)
#NULL
Now I'm trying to do essentially the same, but in a more complicated fashion. I have two network repositories, and I'd like to install packages from the second if the first is not available for some reason. Here's how I do it:
pkg_location <- c("file://main_repo", "file://extra_repo")
lapply(pkg_location, function(repo)
{
tryCatch(install.packages("my-cool-package",
contriburl = repo, dependencies = TRUE),
error = function(e) NULL)
})
And I'm expecting a list of NULLs. However, the error is not suppressed:
Installing package into ‘...’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open compressed file '//extra_repo/PACKAGES',
probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
[[1]]
NULL
[[2]]
NULL
It seems like install.packages somehow ignores the mechanism. How is that possible, why is that happening and how can I approach the problem?
Here's sessionInfo, probably worth noting I'm running RStudio 0.98.977.
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.1.2
RStudio does not exectute the normal install.packages but instead does its own thing:
look at the code in RStudio:
> install.packages
function (...)
.rs.callAs(name, hook, original, ...)
<environment: 0x3e4b478>
> .rs.callAs
function (name, f, ...)
{
withCallingHandlers(tryCatch(f(...), error = function(e) {
cat("Error in ", name, " : ", e$message, "\n", sep = "")
}), warning = function(w) {
cat("Warning in ", name, " :\n ", w$message, "\n", sep = "")
invokeRestart("muffleWarning")
})
}
<environment: 0x3bafa38>
weird code, it recalls itself ...
i was expecting a .Primitive() somewhere
> sum
function (..., na.rm = FALSE) .Primitive("sum")
but it is an ugly RStudio hack. if you look at install.packages in normal R you get:
head(install.packages) # it is really long :P
1 function (pkgs, lib, repos = getOption("repos"), contriburl = contrib.url(repos,
2 type), method, available = NULL, destdir = NULL, dependencies = NA,
3 type = getOption("pkgType"), configure.args = getOption("configure.args"),
4 configure.vars = getOption("configure.vars"), clean = FALSE,
5 Ncpus = getOption("Ncpus", 1L), verbose = getOption("verbose"),
6 libs_only = FALSE, INSTALL_opts, quiet = FALSE, keep_outputs = FALSE,
....
I'm going to suggest closing as off-topic because this is an RStudio problem. Basically, tryCatch is catching the error, but RStudio's error handler prints the error anyway. Thus the reason you're getting a return value:
[[1]]
NULL
[[2]]
NULL
This means tryCatch works. RStudio just prints caught errors weirdly.
Use the namespaced invocation:
utils::install.packages()

Scraping Options Data from Google Finance using R

I recently saw a function that will scrape Options Data from Google Finance
It works fine, but I am trying to use the function to call 20 different stocks (although some of them do not have options data) and save them as a list....
I have modified the getOptionQuote function to fit my needs:
Functions provided from the site above:
# installs RCurl and jsonlite packages. will prompt you to select mirror for download
install.packages("RCurl");library("RCurl")
install.packages("jsonlite");library("jsonlite")
# ******************************************************************
getOC2 <- function(symbol){
output = list()
url = paste('http://www.google.com/finance/option_chain?q=', symbol, '&output=json', sep = "")
x = getURL(url)
fix = fixJSON(x)
json = fromJSON(fix)
numExp = dim(json$expirations)[1]
if(length(numExp)!= 0){
for(i in 1:numExp){
# download each expirations data
y = json$expirations[i,]$y
m = json$expirations[i,]$m
d = json$expirations[i,]$d
expName = paste(y, m, d, sep = "_")
if (i > 1){
url = paste('http://www.google.com/finance/option_chain?q=', symbol, '&output=json&expy=', y, '&expm=', m, '&expd=', d, sep = "")
json = fromJSON(fixJSON(getURL(url)))
}
output[[paste(expName, "calls", sep = "_")]] = json$calls
output[[paste(expName, "puts", sep = "_")]] = json$puts
}}
assign(paste(symbol),do.call(rbind,output))
}
fixJSON <- function(json_str){
stuff = c('cid','cp','s','cs','vol','expiry','underlying_id','underlying_price',
'p','c','oi','e','b','strike','a','name','puts','calls','expirations',
'y','m','d')
for(i in 1:length(stuff)){
replacement1 = paste(',"', stuff[i], '":', sep = "")
replacement2 = paste('\\{"', stuff[i], '":', sep = "")
regex1 = paste(',', stuff[i], ':', sep = "")
regex2 = paste('\\{', stuff[i], ':', sep = "")
json_str = gsub(regex1, replacement1, json_str)
json_str = gsub(regex2, replacement2, json_str)
}
return(json_str)
}
I have basically added the if(length(numExp)!= 0){ to accomodate for stocks that do not have options chains....
Here is what I use to call the 20 stocks:
LIST <- c("AAMC", "AAU", "ACU", "ACY", "ADGE", "ADK", "AE", "AIII", "AINC",
"AIRI", "AKG", "ALN", "ALTV", "AMCO", "AMPE", "AMS", "APP", "APT",
"APTS", "ASM")
library("plyr")
# USE PARALLEL COMPUTING FOR FASTER PROCESS
registerDoParallel(detectCores())
system.time(
OC <- llply(.data=as.list(LIST), .fun=function(x) {
tmp <- try(getOC2(x))
if (!inherits(tmp, 'try-error')) tmp
}, .parallel = TRUE, .paropts=list(c(.packages=(all.available=T))))
)
# user system elapsed
# 0.008 0.001 0.097
I get no errors but OC should have a length of 20, however it only has a length on 1 and produces: list(NULL)
SESSION INFO:
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)
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 stats graphics grDevices utils datasets methods base
other attached packages:
[1] stringr_1.0.0 plyr_1.8.3 doMC_1.3.3 doParallel_1.0.8 iterators_1.0.7 foreach_1.4.2 pbapply_1.1-1 jsonlite_0.9.17
[9] RCurl_1.95-4.7 bitops_1.0-6
loaded via a namespace (and not attached):
[1] Rcpp_0.12.0 lattice_0.20-33 codetools_0.2-14 zoo_1.7-12
[5] grid_3.2.2 magrittr_1.5 PerformanceAnalytics_1.4.3541 stringi_0.5-5
[9] PortfolioAnalytics_1.0.3636 xts_0.9-7 blotter_0.8.19 tools_3.2.2
[13] compiler_3.2.2 quantstrat_0.8.2

devtools::install_github Error in function (type, msg, asError = TRUE) : <not set>

I'm trying to install a package via devtools::install_github for the first time
l#np350v5c:~$ R --vanilla
> library(devtools)
Attaching package: ‘devtools’
The following objects are masked from ‘package:utils’:
?, help
The following object is masked from ‘package:base’:
system.file
> search()
[1] ".GlobalEnv" "package:devtools" "package:stats"
[4] "package:graphics" "package:grDevices" "package:utils"
[7] "package:datasets" "package:methods" "Autoloads"
[10] "package:base"
but, eg
> install_github("devtools")
Installing github repo devtools/master from hadley
Downloading master.zip from https://github.com/hadley/devtools/archive/master.zip
Errore in function (type, msg, asError = TRUE) : <not set>
The output of traceback() is
> traceback()
12: fun(structure(list(message = msg, call = sys.call()), class = c(typeName,
"GenericCurlError", "error", "condition")))
11: function (type, msg, asError = TRUE)
{
if (!is.character(type)) {
i = match(type, CURLcodeValues)
typeName = if (is.na(i))
character()
else names(CURLcodeValues)[i]
}
typeName = gsub("^CURLE_", "", typeName)
fun = (if (asError)
stop
else warning)
fun(structure(list(message = msg, call = sys.call()), class = c(typeName,
"GenericCurlError", "error", "condition")))
}(77L, "<not set>", TRUE)
10: .Call("R_curl_easy_perform", curl, .opts, isProtected, .encoding,
PACKAGE = "RCurl")
9: curlPerform(curl = handle$handle, .opts = curl_opts$values)
8: make_request("get", hu$handle, hu$url, config = config)
7: GET(url, config)
6: (function (url, name = NULL, subdir = NULL, config = list(),
before_install = NULL, ...)
{
if (is.null(name)) {
name <- basename(url)
}
message("Downloading ", name, " from ", url)
bundle <- file.path(tempdir(), name)
request <- GET(url, config)
stop_for_status(request)
writeBin(content(request), bundle)
on.exit(unlink(bundle), add = TRUE)
install_local_single(bundle, subdir = subdir, before_install = before_install,
...)
})(dots[[1L]][[1L]], dots[[2L]][[1L]], subdir = NULL, config = list(),
before_install = function (bundle, pkg_path)
{
desc <- file.path(pkg_path, "DESCRIPTION")
DESCRIPTION <- readLines(desc, warn = FALSE)
if (any(DESCRIPTION == "")) {
DESCRIPTION <- DESCRIPTION[DESCRIPTION != ""]
}
cat(DESCRIPTION, file = desc, sep = "\n")
append_field <- function(name, value) {
if (!is.null(value)) {
cat("Github", name, ":", value, "\n", sep = "",
file = desc, append = TRUE)
}
}
append_field("Repo", conn$repo)
append_field("Username", conn$username)
append_field("Ref", conn$ref)
append_field("SHA1", github_extract_sha1(bundle))
append_field("Pull", conn$pull)
append_field("Subdir", conn$subdir)
append_field("Branch", conn$branch)
append_field("AuthUser", conn$auth_user)
}, dependencies = TRUE)
5: mapply(install_url_single, url, name, MoreArgs = list(subdir = subdir,
config = config, before_install = before_install, ...))
4: install_url(conn$url, subdir = conn$subdir, config = conn$auth,
before_install = github_before_install, ...)
3: FUN("devtools"[[1L]], ...)
2: vapply(repo, install_github_single, FUN.VALUE = logical(1), username,
ref, pull, subdir, branch, auth_user, password, auth_token,
..., dependencies = TRUE)
1: install_github("devtools")
I tryied with another repo but it behaves the same way.
Any hint?
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=it_IT.UTF-8 LC_NUMERIC=C
[3] LC_TIME=it_IT.UTF-8 LC_COLLATE=it_IT.UTF-8
[5] LC_MONETARY=it_IT.UTF-8 LC_MESSAGES=it_IT.UTF-8
[7] LC_PAPER=it_IT.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=it_IT.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_1.5
loaded via a namespace (and not attached):
[1] digest_0.6.4 evaluate_0.5.1 httr_0.2 memoise_0.1 parallel_3.1.0
[6] RCurl_1.95-4.1 stringr_0.6.2 tools_3.1.0 whisker_0.3-2
Actually, I had the same issue and after installing RCurl it worked.
In order to install RCurl in ubuntu, write the following in your terminal:
sudo apt-get install libcurl4-openssl-dev
Then in R:
install.packages('RCurl')
And that's it!
If you can't install the appropriate version of libcurl, you can try using the "install_git" function instead of "install_github". For example,
library(devtools)
install_git("https://github.com/hadley/devtools.git")
That worked for me.
Sorry, this was a bug in the r-cran-rcurl package in Debian. We eventually corrected it in the Debian distribution unstable, testing, and more recently stable (Jessie 8.2). In Ubuntu it is fixed in wily. Sorry for the problem, and thanks for using Debian or its derivatives !

Resources