I am trying to manually add the NPV formula but I am getting the error message Error: attempt to apply non-function
npv<- (2520/(1+0.10))+ (2520(1+0.10)^2)+ (2520(1+0.10)^3)
Please let me know why am I getting this error message and how can I fix this?
Probably, we need the *
(2520/(1+0.10))+ (2520*(1+0.10)^2)+ (2520*(1+0.10)^3)
[1] 8694.229
Related
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 keep getting the following error - could not find function %||%. I would like to know what r library() supports %||% and what this function is doing.
Thanks
Leanne
When trying to run this (or any other) command
xtabs(ugdata$response, ugdata$Equity, data=ugdata)
I keep receiving this error
Error in formula.default(object, env = baseenv()) : invalid formula
I have been looking around all day, including similar posts on this website, but I cannot find a solution to help me fix this.
Any help would be greatly appreciated
I believe the error is in the syntax. Please try:
xtabs(ugdata$response ~ ugdata$Equity, data = ugdata)
I keep getting the error message
could not find function "Qrefine".
Got the error message when I keyed in the following in RStudio. Could someone help, please?
Qrefine.out <- Qrefine(data, Q_mis, gate="AND", max.ite=50)
print(Qrefine.out)
plot(Qrefine.out)
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