TwitteR package download of package ‘rjson’ fails in R

0 votes

I am trying my hand at some data mining and attempting to retrieve data from Twitter.

When I tried installing the package 'twitteR', I get the following warning:

Warning in install.packages :
  download of package ‘rjson’ failed

But it loads the rest of the packages. Then when I try to call the library:

> library(twitteR)
Loading required package: ROAuth
Loading required package: RCurl
Loading required package: bitops

Attaching package: ‘RCurl’

The following object is masked from ‘package:tm.plugin.webmining’:

    getURL

Loading required package: digest
Error: package ‘rjson’ required by ‘twitteR’ could not be found

Which makes sense, if it could not download the 'rjson' package initially.

When I tried to install the 'rjson' package alone, I get a familiar error:

> install.packages("rjson")
trying URL 'http://cran.rstudio.com/bin/macosx/contrib/3.0/rjson_0.2.13.tgz'
Warning in install.packages :
  cannot open: HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'http://cran.rstudio.com/bin/macosx/contrib/3.0/rjson_0.2.13.tgz'
Warning in install.packages :
  download of package ‘rjson’ failed

I am not familiar with troubleshooting these errors. Any help is very much appreciated.

Jun 26, 2018 in Data Analytics by darklord
• 6,170 points
28 views

1 answer to this question.

0 votes

If you don't want to upgrade your R (we're at version 3.1 now), you can install from the archives.

  1. Download version 2.13 from http://cran.rstudio.com/src/contrib/Archive/rjson/rjson_0.2.13.tar.gz
  2. In R, run install.packages("<local path to the downloaded gz file>", repos=NULL, type="source")

Hopefully that will work.

answered Jun 26, 2018 by CodingByHeart77
• 3,690 points

Related Questions In Data Analytics

0 votes
1 answer
+1 vote
1 answer

How to convert a list of dataframes in to a single dataframe using R?

You can use the plyr function: data <- ...READ MORE

answered Apr 13, 2018 in Data Analytics by darklord
• 6,170 points
187 views
0 votes
1 answer

R function for finding the index of an element in a vector?

Yes, we can find the index of ...READ MORE

answered Apr 13, 2018 in Data Analytics by zombie
• 3,690 points
721 views
0 votes
1 answer

Find length of string in R

You can try nchar > nchar("fast") [1] 4 > set.seed(10) > ...READ MORE

answered Apr 17, 2018 in Data Analytics by DataKing99
• 8,130 points
47 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 17, 2017 in Data Analytics by Sudhir
• 1,610 points
54 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
74 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
173 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
120 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
572 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
185 views