Getting Error in readRDS(cache_path) : error reading from connection - r

I am trying to solve quiz 2 in Coursera for Getting and Cleaning Data. I get the error :"Error in readRDS(cache_path) : error reading from connection" when I execute the following statement:
ONgithub_token <- oauth2.0_token(oauth_endpoints("github"), myapp)
I have searched and see that there are solutions for readRDS(file) but not readRDS(cache_path).
I am on Windows10, R version is 3.3.0
Appreciate your help.
Thanks.

Related

Error when installing the 'graphics' package (but not others) in R

I am a starter in R and new to StackOverflow and this is the first time I raise a question, I hope i'm following all the rules...
Anyway. I got R (3.5.0 version) and R-Studio on my laptop with Win 10 Home installed (under the same parent folder 'D:\') and reset the temporary file directory to a folder in D:\ so that the Chinese in C:\Users\中文\documents (which is the default place for tempo files) doesn't affect the connection btw R-studio and R (I was told any relevant directory has to be in English to make R-Studio work).
The problem is, I cannot install the 'graphics' package when I run
install.packages('graphics')
The resulting error says something like this:
>Error in install.packages : Updating loaded packages
>Restarting R session...
>Error in gzfile(file, "wb") : cannot open the connection
>Error saving session (options): R code execution error
>WARNING: Forcing suspend of process in spite of all session data not being fully saved.
It's quite weird since the 'graphics' package is pretty basic and as a matter of fact I haven't found anyone reporting such errors on the internet.
It also bothers me that other packages like 'forecast' and 'XML' can be successfully installed without any error report.
I've looked at some similar questions on StackOverflow, having error reports with "Error in gzfile(file, "wb") : cannot open the connection", but they all seem to have something else to complete the sentence. In my case it just stops the error description with "cannot open the connection". Also I couldn't find people having similar problems with "Error saving session (options): R code execution error".
I do realize that this is quite unusual. I can't even find the proper tags other than r for this question. Although it seems that no one has trouble with the 'graphics', this problem is really bothering me and I hope someone can give possible solutions. Thanks a lot.

gtrendsR error HTTP 410

I am new to use a package, gtrendsR, running in R 3.4.1, windows 10.
I succeeded in gconnect, but i get the following error message for any types of query passing to gtrends like below.
library(gtrendsR)
gconnect(usr=my_user_name,psw=my_password)
google.trends = gtrends(c("NHL"), geo="US",start_date="2017-01-01")
Error: Not enough search volume. Please change your search terms.
In addition: Warning message:
In request_GET(x, url, ...) : Gone (HTTP 410).
Anybody has some ideas to solve the problems?

as.h2o ERROR: Unexpected HTTP Status code: 500 Server Error

I'm trying to do something with h2o in Rstudio, but have problems when using as.h2o(). It always gives back the following error.
For example:
library(h2o)
localH2O = h2o.init()
finaldata.hex = as.h2o(finaldata)
ERROR: Unexpected HTTP Status code: 500 Server Error (url = http://localhost:54321/3/PostFile?destination_frame=%2Fprivate%2Fvar%2Ffolders%2F8z%2F29h4lb311gbdhg58mj704g580000gn%2FT%2FRtmpr83spR%2Ffile12ab3b8df30c.csv_sid_a24d_3)
Error: lexical error: invalid char in json text.
<html> <head> <meta http-equiv=
(right here) ------^
Would you please help me to figure out how to fix this error?
Thanks,
This is super late but I had the same issue and I realized that increasing h2o.glm(...,max_mem_size) made that issue go away. I was converting an extremely large data.table to to an h2o object and was getting this same error message.
This problem is when you are using h2o to change the data frame to h2o format as:
data_h2o <- as.h2O(data)
This is internal error for your Server.
To solve this problem you can restart your server and run it again. I hope this can help you...

R Redshift Error in .jfindClass

reading the Howto on connecting Redshift to R, and am getting an error, any ideas ?
source - https://aws.amazon.com/blogs/big-data/connecting-r-with-amazon-redshift/
after the driver <- line I get this error:
driver <- JDBC("com.amazon.redshift.jdbc41.Driver", "RedshiftJDBC41-1.1.9.1009.jar", identifier.quote="`")
Error in .jfindClass(as.character(driverClass)[1]) : class not found
this error went away when I downloaded the used the 42-driver, not the 41-driver
download.file('http://s3.amazonaws.com/redshift-downloads/drivers/RedshiftJDBC42-1.2.1.1001.jar','RedshiftJDBC42-1.2.1.1001.jar')
Hopefully this will help someone.. on Windows 7
Ray

Error in .jfindClass(as.character(driverClass)[1]) : class not found - Hive R

I am connected to a remote R server which is built on x86_64-redhat-linux-gnu (64-bit) platform. The R version installed in this server is 3.3.1. I want to connect to remote hive database using this R server so that I can extract data and do some analysis on it. I am trying the following things,
options( java.parameters = "-Xmx8g" )
library(rJava)
library(RJDBC)
drv <- JDBC("org.apache.hive.jdbc.HiveDriver",
"/home/username/R/x86_64-redhat-linux-gnu-library/3.3/hive-jdbc-0.10.0.jar",
identifier.quote="`")
I am getting error as Error in .jfindClass(as.character(driverClass)[1]) : class not found. I downloaded the jar file and kept it in this path , /home/username/R/x86_64-redhat-linux-gnu-library/3.3/. I have downloaded only this jar file. Inside this /home/username/R/x86_64-redhat-linux-gnu-library/3.3/ path, I am having three folders such as DBI, rJava and RJDBC and the file hive-jdbc-0.10.0.jar.
Apart from this have not downloaded anything else for now. Is there anything else which I need to download in order for this error to resolve?
Another attempt which I tried was,
hivedrv <- JDBC("org.apache.hadoop.hive.jdbc.HiveDriver",
c(list.files("/home/username/R/x86_64-redhat-linux-gnu-library/3.3/",pattern="jar$",full.names=T),
list.files("/home/username/R/x86_64-redhat-linux-gnu-library/3.3/",pattern="jar$",full.names=T)))
which ran without any error. But when I try the following command,
hivecon <- dbConnect(hivedrv, "jdbc:hive://hostname:portname/", "username", "password")
I am getting the following error,
Error in .jcall(drv#jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/api/MetaException
Not sure how to solve this problem. Can anybody please help me in connecting the R server to Hive database? Any information would be helpful.

Resources