sub() has practical uses though gsub() may have more. This function was what I
needed at the time. Of course the gsub() version is also possible.
Sent from Yahoo Mail on Android
[[alternative HTML version deleted]]
__
R-help@r-project.org mai
Adam,
The original posting gave a function sub2 whose aim differs both from your
functions' aim and from the intent of mgsub() in the qdap package:
> Here is code to apply a different
> pattern and replacement for every target.#Example
X <- c("ab", "cd", "ef")
patt <- c("b", "cd", "a"
t;ef"
By talking instead about simple string matching, I'm afraid you've rather
hijacked the thread.
-John
-John
Adam wrote
> I'm not sure I understand your question. Both functions return "" "CD" ""
> because they
> perform
Can you show what is its solution for the original sample data? Why that
discrepancy for you original sub2() function?
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.
tion(p,r,x) sub(p,r,x, fixed = TRUE),p=patt,r=repl,x=X))
user system elapsed
2.53 0.00 2.52
#Old method 2
system.time(for(i in 1:5)sub2(patt, repl, X)) user system elapsed
2.32 0.00 2.32
#Your proposed method
system.time(for(i in 1:5) sub3(patt, repl, X))
user s
h to predict. If omitted, the
fitted values are used.
-John Thaden, Ph.D.
College Station, TX
--- On Sun, 9/2/12, peter dalgaard wrote:
> From: peter dalgaard
> Subject: Re: [R] predict.lm(...,type="terms") question
> To: "David Winsemius"
> Cc: "R
Dave said my newdata data frame 'new' must have a column named 'area'.
It did. Nonetheless predict.lm throws an error with type = "terms" and
newdata = new. I see nothing in the predict.lm documentation that
bars this usage. Is there a bug?
To illustrate an OLS behavior, I had cited Ludbrook '12.
Draper & Smith sections (3.2, 9.6) address prediction interval issues, but
I'm also concerned with the linear fit itself. The Model II regression
literature makes it abundantly clear that OLS regression of x on y
frequently yields a different line than of y on x. The example below is not
so extreme
n Wed, Aug 29, 2012 at 9:16 AM, John Thaden wrote:
> I think I may be misreading the help pages, too, but misreading how?
>
> I agree that inverting the fitted model is simpler, but I worry that I'm
> misusing ordinary least squares regression by treating my response, with its
>
.
> plot(concn ~ area, data = data)
> abline(inv.model)
> points(data$area, pred1, col="blue", pch="+")
> points(new$area, pred2, col="red", pch=16)
>
>
> Also, 'data' is a really bad variable name, it's already an R function.
>
> H
Hello all,
How do I actually use the output of predict.lm(..., type="terms") to
predict new term values from new response values?
I'm a chromatographer trying to use R (2.15.1) for one of the most
common calculations in that business:
- Given several chromatographic peak areas measured for
Michael,
Where can we read you document that includes "various ideas
going far beyond simply embedding R"? What about Julian's
opinion that Tinn-R is more stable and loads more quickly
than jEdit? Can that be true in a Windows environment?
-John Thaden
12 matches
Mail list logo