I am trying to use the unfold function from package RcmdrPlugin.survival.
I used the following command:
long.df <- unfold(testdf,time="deathint", event="death",
cov=list(31:70,71:110), cov.names=c("adopted","age"))
However, R is returning the following error message:
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
[tcl] wrong # args: should be "winfo rootx window".
I am using R version 3.2.4. Any suggestions?
I had the same problem in R studio. This is how I solved it:
intall.packages("Rcmdr")
It installed R commander gui for me,then I went to R commander gui, installed and loaded RcdmrPlugin.survival and then I ran unfold from there and it worked.
Related
I am trying to run dada2 within RStudio. Normally I would run it in Windows. However because I want to run cutadapt as well I have had to create a Linux VM. With some help I now have dada2 and cutadapt installed on my VM. I have copied over my R code which works in RStudio in Windows. I have editted the code on my VM so that it points towards the correct directories, e.g. replaced "c:\Rtemp" with "~/Rtemp". I believe I have done this correctly as RStudio reads in dada2 and then my files just like it does when I start the script in RStudio in Windows. However I then get error messages that I don't get when I run the script in RStudio in windows.
fnFs <- sort(list.files(path, pattern="_R1_001.fastq", full.names = TRUE))
fnRs <- sort(list.files(path, pattern="_R2_001.fastq", full.names = TRUE))
sample.names <- sapply(strsplit(basename(fnFs), "_"), `[`, 1)
plotQualityProfile(fnFs[1:2])
Error in (function (cond) :
error in evaluating the argument 'dirPath' in selecting a method for function 'qa': IncompatibleTypes
message: error in evaluating the argument 'x' in selecting a method for function 'which': error in evaluating the argument 'x' in selecting a method for function 'alphabetFrequency': invalid class “BStringSet” object: undefined class for slot "elementMetadata" ("DataTable_OR_NULL")
There are no "install" errors so I don't think the problem is missing installs. Is this error message indicating a problem with the amount of memory on my VM?
I recently ran into this problem while working through the dada2 tutorial.
I fixed it by loading up library(Biostrings) before loading dada2. I was under the impression that dada2 automatically loaded up Biostrings, but this was the fix. Hopefully it works for you.
I ran install_github('zhangyuqing/sva-devel') (recommended here: https://github.com/jtleek/sva-devel/issues/14) but cannot run the function ComBat() afterwards, getting shows Error in ComBat() : could not find function "ComBat".
More generally put, how do I do in R what import sva-devel does in Python?
I tried
> library('sva')
Error in library("sva") : there is no package called ‘sva’
> library('sva-devel')
Error in library("sva-devel") : there is no package called ‘sva-devel’```
In R I get the following errors any time I hit View() or data.frame and I do not understand why. It happened suddenly.
> View(Fhat_all)
Error in .External2(C_dataviewer, x, title) : unable to start data viewer
In addition: Warning message:
In View(Fhat_all) : unable to open display
> da <- data.frame(comb[true_comb_RMSE[1],1], comb[true_comb_RMSE[1],2],
comb[true_comb_KS[1],1],comb[true_comb_KS[1],2])
Error in (function (env, objName) :
could not find function "object.size"
I checked this other page in Stackoverflow Can't use either View() or edit() functions, getting "Error in .External2(C_dataviewer, x, title) : invalid device" error message but I didn't understand how to fix it. So I hit locale on terminal and got this result:
Last login: Mon Mar 21 16:47:07 on ttys000
MacBook-Pro:~ "username"$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
MacBook-Pro:~ "username"$ LC_CTYPE = C R
-bash: LC_CTYPE: command not found
so I hit LC_CTYPE=C R on the the terminal as by suggestion and tried to view a vector in R, but I got the same error message:
> View(w)
Error in .External2(C_dataviewer, x, title) : unable to start data viewer
In addition: Warning message:
In View(w) : unable to open display
Can you please help me? Thank you.
I had the same issue. I opened XQuartz and then the View() function worked.
Experienced this after updating some packages.
Restart R worked for me (in RStudio: Ctrl+Shift+F10). After that, the error vanished and View worked well again.
I had the same error when using the jagsUI package, which masks the View function. Perhaps you have conflicts between packages?
Check potential conflicts between functions by calling conflicts(detail=TRUE) (Taken from this answer for finding which functions are masked in R).
Easiest workaround in my case was calling detach("package:jagsUI", unload = TRUE) once I finished using JAGS.
Delete the view(), then it will work!
I am using package installr version 0.17.0 to update R and related packages. However, I get the following error message when I typed updater():
Error in strsplit(version_with_dots, "\\.")[[1]] :
subscript out of bounds
How can I deal with this situation?
The current version of R is "3.2.4 Revised". installr appears to be having trouble with the " Revised" part of the name. The bug has been fixed in the latest version of the package.
I need your help with R not being able to run a function with rworldmap package.
When using rworldmap package in R and trying to 'joinCountryData2Map'
sPDF <- joinCountryData2Map (myframe, joinCode = "NAME", nameJoinColumn = "location", verbose = TRUE, suggestForFailedCodes = TRUE )
I get the following error:
Error in mapWithData#data <- cbind(mapWithData#data, dF[matchPosnsInUserData, :
could not find function "checkAtAssignment"
Calls: joinCountryData2Map
Execution halted
My guess is that R needs methods package, which I could not find for my R version.
Any suggestings why I 'could not find function "checkAtAssignment"'?
My R version is 3.0.2 Patched.
Using rworldmap package requires loading library(methods). I am writing it here because it was really not obvious.
Dunno what "R 3.0.2 Patched" means, but yes you are correct that somehow you don't have the methods package, which is included in the standard installation package. How about reinstalling R from the binaries or source tarball at CRAN -- that should solve your problem.