Closed luispfonseca closed 5 years ago
if the vanilla works fine, then it is likely that you had used rcall before and have a memory that is loaded when you call R interactively. you can try starting a new R session, typing rcall clear
. does that help?
Thank you for getting back. I think the issue remains:
. rcall vanilla: print("a")
[1] "a"
rcall: print("a")
Error in if (substr(packageList[i], 1, 8) == "package:") { :
missing value where TRUE/FALSE needed
Calls: stata.output
Execution halted
[1] "a"
. rcall clear
(R memory cleared)
. rcall: print("a")
Error in if (substr(packageList[i], 1, 8) == "package:") { :
missing value where TRUE/FALSE needed
Calls: stata.output
Execution halted
[1] "a"
I wrote a command called rcallcountrycode to interact with an R package using rcall. Thank you for this.
hhmm,
Could you edit a file named stata.output.r
in your PLUS directory?
type: fedit stata.output.r
, if you have fedit
package installed
You can try replacing https://github.com/haghish/rcall/blob/6758660c85033b9889434ed08b60f2550f0be78a/stata.output.r#L293
with a code paragraph, placed into a logical statement, as shown below:
if (length(packageList) > 0) {
for (i in 1:length(packageList)) {
# Attach packages
if (substr(packageList[i], 1, 8) == "package:") {
name <- substr(packageList[i], 9, nchar(packageList[i]))
write(paste("library(", name, ")", sep = ""), file=RProfile, append=TRUE)
}
# Attach variables and data
else {
name <- packageList[i]
write(paste("attach(", name, ")", sep = ""), file=RProfile, append=TRUE)
}
}
}
This will prevent evaluating the packageList
when its length is 0. Maybe that solves the problem? If so, I'll update the code.
PS. I will checkout your package, awesome!
fixed in rcall 2.5.0 version
Sorry for not getting back to you earlier. I confirm this has been fixed. Thank you!
I get an error when installing the package. My machine is running Ubuntu 18.04.2. No issues when installing in a windows machine. Vanilla version of
rcall
seems to work fine, but default mode resurfaces the error again, even if it prints test output. Do you know what this might be?Thank you for the package. I've used it to call R packages and it is extremely useful.