How to get rid of this warning message - r

When I just open the Rstudio and press entre on the Console, it always give me the warning message
>
Warning message:
In .recacheSubclasses(def#className, def, env) :
undefined subclass "numericVector" of class "Mnumeric"; definition not updated
>
How to get rid of this warning message?
Thank you!
I previously ran boot::boot() function using multicore processing, and after that when I start Rstudio and run the first command, the warning message always appears.

Try these steps:
Update R to the newest version [click here]
Re-install the boot package of whatever packages that face this warning. I suggest the following code for that:
remove.packages('boot')
install.packages('boot', dependencies=T)
library(boot)
Restart your R or Rstudio and try to use your function again. If it bothers you again, you can ignore it using options(warn=-1).
Best of Luck.

Related

how can fix this issue "Error in h2o.upload_model() : could not find function "h2o.upload_model"?

I have installed h2o package(in R from RStudio console). Post h2o.init() I am trying to use the built in function upload_model()/upload_mojo() but I am getting following error.
h2o.upload_mojo()
Error in h2o.upload_mojo() : could not find function "h2o.upload_mojo"
h2o.upload_model()
Error in h2o.upload_model() : could not find function "h2o.upload_model"
I found work around to resolve this issue. Please find below the steps I followed:
Remove the package using: remove.packages("h2o")
Quit the current session and launch the new one.
Move out lock file for h2o from path where package was installed mostly under R with file name like - 00LOCK-h2o
Install new/latest version of package via RStudio console using install.packages()
It should now resolve this issue.

RStudio v1.1.456 Rpubs upload error, no login prompt

Hi I couldn't find any useful information in regards to this one.
When I try to publish to Rpubs on Rstudio v1.1.456, instead of login prompt I get this error message below.
[Edited] Rstudio v1.1.456, R v3.5.1
Upload Error Occurred Error in if (result$status == 201) succeeded <-
TRUE : missing value where TRUE/FALSE needed Calls: In
addition: Warning message: In http(protocol, "api.rpubs.com", port,
method, path, headers, : NAs introduced by coercion Execution
halted
I've already addded this line
options(rpubs.upload.method = "internal")
to both global and working directory Rprofile
Apparently, there was an issue in the most recent version of rsconnect (0.8.12).
devtools::install_github("rstudio/rsconnect", ref = "bugfix/multi-status-header")
Installing the patch solves it.

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.

Error handling in R in RStudio -- don't invoke debugger?

I'm trying to create error messages similar to those you can find in R package dplyr that don't invoke RStudio's debugger and simply stop and print an informative message.
So for example in RStudio if you use:
library(dplyr)
group_by(blah)
You get an informative error but the debugger is not invoked so the "interruption" to the user is minimal, they realize the issue and fix the code. But when I use
myfunc<-function(val){
if(val>3) stop("This is error", call.=FALSE)
}
myfunc(4)
The debugger is triggered and it's more unpleasant. How do I simply give a nice error message with out starting the debugger? What is the difference in how dplyr is creating error messages and mine? I did look at the GitHub repo but wasn't sure.

Running command had status 1

I've tried to run command in R 2.15.2
rsaga.geoprocessor(lib="ta_channels", module=0, param=list(ELEVATION="DEMflt.sgrd", CHNLNTWRK=paste("channels", i, ".sgrd", sep=""), CHNLROUTE="channel_route.sgrd", SHAPES="channels.shp", INIT_GRID="DEMflt.sgrd", DIV_CELLS=3, MINLEN=40), show.output.on.console=FALSE)
and I'm constantly getting this warning:
Warning message:
running command '"C:/Users/Nenad/Documents/R/win-library/2.15/RSAGA/SAGA-GIS/saga_cmd.exe" ta_preprocessor 2 -DEM "DEM1.sgrd" -RESULT "DEMflt.sgrd" -MINSLOPE "0.05"' had status 1
I use windows 8 and also tried to ran R as admin.
Any idea what is the problem? Thanks!
Idk how actual it is, but I've been struggling with "had status 1" warning a lot. Especially it got really annoying when I tried to use seasonal package to conduct the X13-ARIMA-SEATS seasonal decomposition of time series. The seasonal::seas command just didn't work, because in the code of this command there is a stop condition when running a certain stuff with cmd.exe returns non-zero status. While, as it was mentioned before, 'status 1' doesn't prevent command execution, in case of seasonal package it does.
The problem in my case was caused by some mistake in Windows Registry (Win 10), that in turn caused warning System cannot find the path specified when launching CMD.exe or PowerShell, which caused warning inside R as well. So to fix it:
Press Win+R -> regedit
In HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor folder clean the value of Autorun record (it should be empty)
Do the same for Autorun in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
After these actions annoying warning with "has status 1" has gone and seasonal::seas started to work perfectly.
Hope it will be usefull for somebody.
Running system commands from R can be really tricky. In my experience, as long as the exit code is not 127 then the command did run, and you could use the intern=TRUE switch in the system command for a more verbose output. If you run the command again, the warning message could contain a errmsg attribute as well for some more info. hth

Resources