I'm having trouble locating the packages for corhelp in R. This is what I get.
AdjMatHARD=abs(corhelp[restConnectivity,restConnectivity])>0.65+0.0
# Error: object 'corhelp' not found
Assuming you're following the code from YEAST
Gene Co-expression Network Analysis R Tutorial, corhelp is a variable defined in the code
corhelp=cor(datExpr,use="pairwise.complete.obs")
just search that page for corhelp to find it.
Related
I’m new in R and try to use it for the GCA/SCA analysis using North Carolina design 2 under agricolae (function: Carolina). I created a small dataset, named as ncd2 and used read to upload. After that I used head(ncd2) to check and everything looked fine.
However, if I use data(ncd2), it gives me the following error message
Warning message:
In data(ncd2) : data set ‘ncd2’ not found
Because of it, I can’t use carolina2 for my analysis. Any help? Thanks. Mack
I tried to run the code in Chapter 7 Data mining with R learning with case study book but I got an error in following line:
rankWorkflows(svm, maxs = TRUE)
The error was:
Error in as.character.default(X[[i]], ...) : no method for coercing
this S4 class to a vector
Then I searched on the internet and found following solution:
importMethodsFrom(GenomicRanges, as.data.frame)
and again again I got a new error:
Error: could not find function "importMethodFrom"
I searched a lot but I got nothing :(
You can try using library(sos) to find the packages where your function is located.
library(sos)
findFn("replaceherewithyourfunction")
Based on the answer of #Bea, there does not seem to be a importMethodsFrom anywhere in R. My guess is you found the call in a NAMESPACE file. Those files have different syntax than normal R scripts.
If you want to load a specific function from an R package (rather than all functions from a package), you can use libraryname::functionname instad of functionname in your code. In your case, replace as.data.frame with GenomicRanges::as.data.frame
If this does not work (for example because you don't have as.data.frame anywhere in your code), you can also load the whole GenomicRanges library with library(GenomicRanges)
I am trying to use the package paleotree to build LTT plots, but I get the following error when I try to input my trees.
a=read.tree(file.choose()) # to choose newick/nexus file
multiDiv(a)
Error in multiDiv(a) : Data of Unknown Type
Does paleotools only take objects of class 'multiphylo' ? I converted the imput tree to class multiphylo, but it still gives the same error. Can anyone suggest how to go about it?
I'm the author of package paleotree. I think what is going on here is that you are passing a single tree to multiDiv, which is setup for analyzing lists of objects, each of which are converted to a diversity curve. You probably want phyloDiv() instead. I can't be certain without know more about your data.
I'm trying to duplicate a text mining example on text mining Twitter data using R programming language found in
Section 10.2 of Yanchang Zhao's paper R and Data Mining: Examples and Case Studies. Zhoa includes a Twitter data sample rmdTweets.RData so the user doesn't have to get the Twitter data directly from Twitter website.
Zhoa's Twitter sample "rmdTweets.RData" is downloaded to my computer; the required R packages 'tm' and 'twitteR' have been loaded without error; and the working directory has been set to the directory containing "rmdTweets.RData", i.e. setwd("F:/R/Test tm/Twitter_Data/") .
When running this command from Zhoa's paper
df <- do.call("rbind", lapply(rdmTweets, as.data.frame))
I get the error:
Error in lapply(rdmTweets, as.data.frame) : object 'rdmTweets' not found
Can you help me with this error?
Also, I'm new to R and am having trouble finding help on the do.call function written in 'beginner' language, so I can understand "rbind" and lapply
You need to load the data file in first.
load("rmdTweets.RData")
I am trying to read probes from a dat file, put them in a vector then put the vector into a subset to be able to concatenate more data to it and write it in a CSV file. Here my piece of code:
library(Biobase)
library(affy)
affys <- read.csv("address of my dat file")
affys_vec <- as.vector(affys)[,1]
exprs(eset)[affys_vec,] -> sub.set
write.csv(sub.set,file="subset.csv")
However when I reach to the : exprs(eset)[affys_vec,] -> sub.set
I get the following error message:
** Error in exprs(eset) :
error in evaluating the argument object' in selecting a method for function 'exprs':
Error: object 'eset' not found **
Are there any suggestions please?
Thanks,
pqtm
See the vignette An introduction to Biobase and ExpressionSets available on your computer, once Biobase is installed, as
vignette(package="Biobase", "ExpressionSetIntroduction")
But the idea is that you have created eset by pre-processing some CEL or other vendor-specific files. How you pre-process those depends on what your files are, maybe with affy or oligo or lumi, or from a public repository using a package like ArrayExpress or GEOquery Or perhaps you're using limma and have no need for an expression set.
The Bioconductor web site and mailing list provides a lot more information.