Skip to content

Commit

Permalink
2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
haghish committed Feb 28, 2019
1 parent 6758660 commit cf7798b
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions stata.output.r
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,24 @@ stata.output <- function(plusR, Vanilla="") {
#Get RProfile from global
file.create(RProfile)

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)
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)
}
}
}


}
}

0 comments on commit cf7798b

Please sign in to comment.