Skip to content

Commit

Permalink
Updated assign calls to inherits = !TRUE to avoid problems in global …
Browse files Browse the repository at this point in the history
…environment
  • Loading branch information
Auburngrads committed Sep 9, 2020
1 parent 7e845c9 commit 7131dd3
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions R/ADDTsim.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function (ADDT.test.plan, ADDT.plan.values, number.sim = 3, plotem = F,
}
data.ddd[, response.column] <- the.response
cat("\nStart simulation", i, "of", number.sim, "\n")
assign(envir = .frame0, inherits = TRUE,"last.sim.ADDT.ddd", data.ddd)
assign(envir = .frame0, inherits = !TRUE,"last.sim.ADDT.ddd", data.ddd)
if (i <= as.numeric(plotem)) {
dest.degrad.mle.out <- groupm.Dest.Degrad(data.ddd,
distribution = distribution, transformation.response = transformation.response,
Expand All @@ -173,7 +173,7 @@ function (ADDT.test.plan, ADDT.plan.values, number.sim = 3, plotem = F,
collapse = ",")))
file.name <- paste("ProblemData", floor(runif(1) *
1e+07), ".ddd", sep = "")
assign(envir = .frame0, inherits = TRUE,file.name, data.ddd)
assign(envir = .frame0, inherits = !TRUE,file.name, data.ddd)
cat("\nCheck stored data in", file.name, "\n")
}
else {
Expand Down
2 changes: 1 addition & 1 deletion R/ComputeSummarizeMultiple.SimRMDOverTime.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function (RMD.pv, RMD.plan.vec, EvaluateEndTimes, begin.time = 1,
MysetOldClass(attr(plan.results, "class"))
cat("Saving simulations results", results.object.name,
"\n")
assign(envir = .frame0, inherits = TRUE,results.object.name, plan.results)
assign(envir = .frame0, inherits = !TRUE,results.object.name, plan.results)
}
results.matrix[, j] <- SummarizeMultiple.SimRMDOverTime
SimulatedQuantileSummary(plan.results, p = p, plot.stuff = plot.stuff,
Expand Down
12 changes: 6 additions & 6 deletions R/FillRegion.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function (gmle.out,
dir.vector <- x/sqrt(sum(x^2))
return(dir.vector)
}
assign(envir = .frame0, inherits = TRUE,"iter.count", 0 )
assign(envir = .frame0, inherits = !TRUE,"iter.count", 0 )
start.date <- date()
theta.hat <- gmle.out$est.out$x
dim <- length(theta.hat)
Expand Down Expand Up @@ -144,10 +144,10 @@ function (gmle.out,
debug1 <- 1
log.like <- gmle.out$log.like
std.error <- gmle.out$t.standard.error
assign(envir = .frame0, inherits = TRUE,"model", value = gmle.out$model)
assign(envir = .frame0, inherits = TRUE,"debug1", value = debug1)
assign(envir = .frame0, inherits = TRUE,"log.like", value = gmle.out$log.like)
assign(envir = .frame0, inherits = TRUE,"data.ld", value = gmle.out$data.ld)
assign(envir = .frame0, inherits = !TRUE,"model", value = gmle.out$model)
assign(envir = .frame0, inherits = !TRUE,"debug1", value = debug1)
assign(envir = .frame0, inherits = !TRUE,"log.like", value = gmle.out$log.like)
assign(envir = .frame0, inherits = !TRUE,"data.ld", value = gmle.out$data.ld)
sim.bound <- log.like(theta.hat) + 0.5 * qchisq(conf.level,dim)
pt.bound <- log.like(theta.hat) + 0.5 * qchisq(conf.level,1)
size <- trunc(iter/cull)
Expand Down Expand Up @@ -290,6 +290,6 @@ function (gmle.out,
upper.2close = upper.2close, lower.2close = lower.2close,
conf.level = conf.level, gmle.out = gmle.out, date = gmle.out$date)
oldClass(return.list) <- "FillRegion.out"
assign(envir = .frame0, inherits = TRUE,jcrname, value = return.list)
assign(envir = .frame0, inherits = !TRUE,jcrname, value = return.list)
return(gmle.out)
}
2 changes: 1 addition & 1 deletion R/FitLinearDegradationData.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function (PassedData, print.stuff = T, plot.stuff = T, observation.time.range =
if (plot.stuff)
PlotData.rmd(PassedGroupedData)
}
assign(envir = .frame0, inherits = TRUE,"RMD.data.grouped", PassedGroupedData)
assign(envir = .frame0, inherits = !TRUE,"RMD.data.grouped", PassedGroupedData)
control.list <- lmeControl(maxIter = maxIter, msMaxIter = msMaxIter,
msVerbose = msVerbose, niterEM = niterEM)
rmd.fit <- lme(RMD.data.grouped, random = ~Time, control = control.list)
Expand Down
4 changes: 2 additions & 2 deletions R/Gamma.mle.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ Gamma.mle <-
names(thetaorig) <- model$orig.param.names
return(thetaorig)
}
assign(envir = .frame0, inherits = TRUE,"iter.count", 0 )
assign(envir = .frame0, inherits = TRUE,"debug1", debug1)
assign(envir = .frame0, inherits = !TRUE,"iter.count", 0 )
assign(envir = .frame0, inherits = !TRUE,"debug1", debug1)
probs <- cdfest(data.ld)$prob
p1 <- min(probs[probs > 0])/2
p2 <- 0.9 * max(probs)
Expand Down
2 changes: 1 addition & 1 deletion R/GetAxesRange.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SetAxesRange <- function (type, x.axis, xlim, xlab, y.axis, ylim, ylab)
sep = ""))
the.list[[the.axes.name]] <- list(xlim = xlim, x.axis = x.axis,
xlab = xlab, ylim = ylim, y.axis = y.axis, ylab = ylab)
assign(envir = .frame0, inherits = TRUE,file.name, the.list)
assign(envir = .frame0, inherits = !TRUE,file.name, the.list)
invisible()
}

Expand Down
2 changes: 1 addition & 1 deletion R/MakeMultipleRdu.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ function (frame.names, ID.column, time.column, event.column)
"Data"))
file.name <- paste(frame.names[i], "rdu", sep = ".")
cat("Saving subset", file.name, "\n")
assign(envir = .frame0, inherits = TRUE,file.name, value = frame.rdu)
assign(envir = .frame0, inherits = !TRUE,file.name, value = frame.rdu)
}
}
2 changes: 1 addition & 1 deletion R/MysetOldClass.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ function (Classes, where = 1)

allOldClasses <- sort(unique(c(Classes[[1]], allOldClasses)))

assign(envir = .frame0, inherits = TRUE, "oldClasses", allOldClasses)
assign(envir = .frame0, inherits = !TRUE, "oldClasses", allOldClasses)
invisible()
}
2 changes: 1 addition & 1 deletion R/NHPP.mle.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function (data.rdu,
theta.start = c(NA,NA),
kprint = 0,...)
{
assign(envir = .frame0, inherits = TRUE,"debug1", debug1)
assign(envir = .frame0, inherits = !TRUE,"debug1", debug1)

options(digits = 5)
func.call <- match.call()
Expand Down
2 changes: 1 addition & 1 deletion R/SetAxesRange.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ function (type, x.axis, xlim, xlab, y.axis, ylim, ylab)
sep = ""))
the.list[[the.axes.name]] <- list(xlim = xlim, x.axis = x.axis,
xlab = xlab, ylim = ylim, y.axis = y.axis, ylab = ylab)
assign(envir = .frame0, inherits = TRUE,file.name, the.list)
assign(envir = .frame0, inherits = !TRUE,file.name, the.list)
invisible()
}
2 changes: 1 addition & 1 deletion R/SplitFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function (frame, split.variable, name.prefix = deparse(substitute(frame)),
file.name <- paste(name.prefix, SubFrameListNames[i],
sep = sepChars)
cat("Saving subset", file.name, "\n")
assign(envir = .frame0, inherits = TRUE,file.name, value = SubFrameList[[i]])
assign(envir = .frame0, inherits = !TRUE,file.name, value = SubFrameList[[i]])
}
namesOfObjects <- paste(name.prefix, SubFrameListNames, sep = sepChars)
invisible(namesOfObjects)
Expand Down

0 comments on commit 7131dd3

Please sign in to comment.