Displaying 2 results from an estimated 2 matches for "builddecaymodel".
2011 Feb 11
1
Passing function arguments
Hi All,
Im looking for some help passing function arguments and referencing them,
I've made a replica, less complicated function to show my problem, and how
i've made a work around for this. However i suspect there is a _FAR_ better
way of doing this.
If i do:
BuildDecayModel <- function(x = "this", y = "that", data = model.data) {
model <- nls(y ~ SSexp(x, y0, b), data = model.data)
return(model)
}
...
"Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
0 (non-NA) cases"
This function returns an error be...
2011 Feb 15
1
Passing Arguments in a function
...h = xv)" i've tried various flavours or paste(),
but again can't figure out where i am going wrong, any help appreciated.
PlotDecayModel <- function(x = "total.reach",
y = "lift",
data) {
decay.model <- BuildDecayModel(x= "total.reach",
y = "lift",
data = data)
# Plot the lift Vs reach plot.
plot(data[[x]], data[[y]])
# Add the model curve to the plot.
xv <- seq(min(data[[x]]), max(data[[x]]), 0.02)
yv <- predict...