Re: [R] small problem in coding

2010-11-26 Thread MacQueen, Don
As Nick suggested, you're confusing the name of an object with the name(s) of its elements. Study this example: > > lamda <- 0.2 > lamda [1] 0.2 > lamda <- c(g=0.2) > lamda g 0.2 > lamda <- c(1,3,4) > lamda [1] 1 3 4 > lamda <- c(g=1, x=3, foo=4) > lamda g x foo 1 3 4 lamda

Re: [R] small problem in coding

2010-11-26 Thread Nick Sabbe
Hello Mike. I'm not clear on why you would want to "state your g parameter" (In fact, I don't even know for sure what you mean by that) with > lamda<-c(g=0.2) If you want a variable (vector) g containing 0.2, why don't you simply do: > g<-0.2 If you need that lamda thing for some reason later on,

Re: [R] small problem in coding

2010-11-26 Thread Ivan Calandra
Euu... g <- 0.2 Q <- exp(g) or lamda <- c(g=0.2) exp(lamda) Ivan Le 11/26/2010 09:12, Mike Gibson a écrit : I must be missing something. I first state my g parameter with: lamda<-c(g=0.2) However, when I do the next step R is telling me "object g not found" Here is my next step: Q<-e