Henrik's proposal works well, so far. Thanks very much. I could not
have figured that out (without much more suffering).
Here's the working example
in case future googlers find their way to this thread.
## Paul Johnson
## 2012-01-30
## Special thanks to r-help email list contributors,
## espe
On 30/01/2012 1:26 PM, Paul Johnson wrote:
A user question today has me stumped. Can you advise me, please?
User wants a matrix that has some numbers, some variables, possibly
even some function names. So that has to be a character matrix.
It might make more sense for it to be a list-mode ma
On Mon, Jan 30, 2012 at 1:26 PM, Paul Johnson wrote:
> A user question today has me stumped. Can you advise me, please?
>
> User wants a matrix that has some numbers, some variables, possibly
> even some function names. So that has to be a character matrix.
> Consider:
>
>> BM <- matrix("0.1", 5
The quick solution:
parseAndEval <- function(x, ...) eval(parse(text=x))
apply(BM, MARGIN=c(1,2), FUN=parseAndEval)
My $.02
/Henrik
On Mon, Jan 30, 2012 at 10:26 AM, Paul Johnson wrote:
> A user question today has me stumped. Can you advise me, please?
>
> User wants a matrix that has some nu
Are you sure this isn't a dataframe? Some minor rethinking of the
structure might get it there.
Rich
On Mon, Jan 30, 2012 at 1:26 PM, Paul Johnson wrote:
> A user question today has me stumped. Can you advise me, please?
>
> User wants a matrix that has some numbers, some variables, possibly
A user question today has me stumped. Can you advise me, please?
User wants a matrix that has some numbers, some variables, possibly
even some function names. So that has to be a character matrix.
Consider:
> BM <- matrix("0.1", 5, 5)
Use data.entry(BM) or similar to set some to more abstract
Try this:
library(RMySQL)
#conn <- dbConnect(...)
mysqlEscapeStrings(conn, "tes't")
On Tue, Aug 10, 2010 at 3:02 AM, Orvalho Augusto wrote:
> Hello guys! May be I am lazy but
>
> I need to replace a character like \ or ' or to escape them in a character
> vector to write a SQL statement.
>
> Ho
On Aug 10, 2010, at 2:02 AM, Orvalho Augusto wrote:
Hello guys! May be I am lazy but
I need to replace a character like \ or ' or to escape them in a
character
vector to write a SQL statement.
?sub
?regex
How can I do that?
Caveman
--
David Winsemius, MD
West Hartford, CT
___
Hello guys! May be I am lazy but
I need to replace a character like \ or ' or to escape them in a character
vector to write a SQL statement.
How can I do that?
Caveman
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
Try this:
library(alr3)
library(gsubfn)
example(delta.method) # defines m1
num <- 2
fn$delta.method(m1, "-b1/($num*b2)")
See gsubfn home page at:
http://gsubfn.googlecode.com
On Thu, Nov 6, 2008 at 12:13 PM, Christoph Scherber
<[EMAIL PROTECTED]> wrote:
> Dear all, Dear Keith,
>
> Well, of cou
Dear all, Dear Keith,
Well, of course in fact the problem is more complicated than that. The example was just for
illustration.
I have several statistical models for which I want to retrieve predictions using delta.method (from
library(alr3)).
Now for this I need a character string such as
Hi,
Firstly, I'd recommend using '<-' for assignment, rather than '='; it saves
confusion
Secondly, I don't think you want 'a*x+b' as a formula, I think you want an
expression.
Thirdly, your 'y' has only one term, a 9 character constant = "a * x + b"
Consider instead,
y <- expression(a*x+b)
a
On Thu, 6 Nov 2008, Christoph Scherber wrote:
Dear all,
How can I replace text in objects that are of class "formula"?
y="a * x + b"
class(y)="formula"
grep("x",y)
y[1]
What exactly are you trying to accomplish??
And why did you assign 'formula' as the class of a character string?
'y' is
Dear all,
How can I replace text in objects that are of class "formula"?
y="a * x + b"
class(y)="formula"
grep("x",y)
y[1]
Suppose I would like to replace the "x" by "w" in the formula object "y".
How can this be done? Somehow, the methods that can be used in character objects do not work 1:1
14 matches
Mail list logo