Using the syuzhet package in R, the following works but returns a warning message:
object <- get_text_as_string("path/name.txt")
When I put this in a function, it returns the same warning error but does NOT change the value of object:
gen <- function(file){
object <- get_text_as_string(file)
}
gen("path/name.txt")
This is the warning message, if it matters:
Warning message:
In readLines(path_to_file) :
incomplete final line found on 'path/name.txt'
...but again, I get that from get_text_as_string() when used outside of the function, but it DOES change the value of object.
Anyone have any advice? There must be something I don't understand about functions?
(I've looked for similar questions/answers, if I've missed the right one I'd be happy to just be directed there.)
I am reading 2 vcf files in to R. They load fine (I have used 3 different methods to do this (read.vcf, readVCF, and fread) and all are fine) however when I go on to try and do anything with 1 of the vcf files, the msg reads:
Error in unlist_as_integer(x#subscript) : object 'fancy_mseq' not found
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'from': object 'fancy_mseq' not found
Usually I just google error msgs but I can not find anything online about this. Does anyone have any idea what could be causing this error message? Whilst it's hard to be 100% sure because of the vcf format, I can't see anything wrong with the file when I call str(), head() or any other ways of looking at the data.
Thank you!
I am trying to run MetaboAnalyst 3.0.3 Pathway Analysis on R (see session information below), and I am getting an error when I try to run the second line of code.
Pathway Analysis Tutorial
I keep getting this error:
> mSet<-InitDataObjects(data.type = "conc", anal.type = "pathora", FALSE)
Error: $ operator is invalid for atomic vectors
Session Info
I tried following this advice but will no luck. I would really appreciate guidance on this seemingly trivial problem!
Trying to use the latest version of methylSig package (0.3.2), and getting an error when using the methylSigCalc function.
I get a cryptic error message after it figures out the number of loci:
Total number of bases: 2.59m
Error in result[, 3] : subscript out of bounds”
I tried running the code of the methylSigCalc function line by line, and the first error I encounter is when it gets to the methylSig_dataProcess function (below is the error after specifying just one core to try to get a useful error message):
Error in do.call(rbind, lapply(which(validLoci),
methylSig_dataProcess, : error in evaluating the argument 'args' in
selecting a method for function 'do.call': Error in match.fun(FUN) :
object 'methylSig_dataProcess' not found
It does seem that methylSig_dataProcess is now missing from the package.
Any suggestions on where I might be going wrong?
Many thanks,
gogatea
I would like to retrieve power hedging data using Rbbg bloomberg package in R and I know this formula works in excel :
=BDH("VATT SS Equity","BI_%_ELECTRIC_POWER_HEDGED","01/01/2000","","GEOGRAPHIC_LOCATION_OVERRIDE=EUCN","BI_CONTRACT_MATURITY_OVERRIDE=CY12","FUND_PER=Q")
But when I try this in R :
conn<-blpConnect(log.level="off")
data<-bdh(conn,"VATT SS Equity","BI_PER_ELECTRIC_POWER_HEDGED","20000101","","GEOGRAPHIC_LOCATION_OVERRIDE=EUCN","BI_CONTRACT_MATURITY_OVERRIDE=CY12","FUND_PER=Q")
I get the following error message :
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
org.findata.blpwrapper.WrapperException: response error: Invalid override field id specified [nid:217]
What should I change in the formula to make it work ?
Thanks
Edit: Indeed it is BI_PCT_ELECTRIC_POWER_HEDGED, however the problem does not come from here but from the overrides.
This returns an empty variable for me, but it doesn't throw an error so it might get you on the right track.
The way you specify options is different in the current version it seems.
data<-bdh(conn,"VATT SS Equity", "BI_PER_ELECTRIC_POWER_HEDGED","20000101","",
override_fields=c("GEOGRAPHIC_LOCATION_OVERRIDE",
"BI_CONTRACT_MATURITY_OVERRIDE",
override_values=c("EUCN","CY12"),
option_names="periodicitySelection",
option_values="QUARTERLY")
The doc where I found the correct syntax is here: RBloomberg. It was written in 2010 for the predecessor package (before Bloomberg complained about using their name) but I guess it works! I think the convention of enumerating the list of option names then the option values is odd compared to your assumption that OPTION=VALUE was correct, but there you go.