Re: [R] copy values from one dataframes into another

2011-02-23 Thread D Sonderegger
What you want to do is create a new dataframe that includes all the years. > newdata <- data.frame( Year=1981:1988 ) > merge(fire, newdata, all=TRUE) If you don't include the all=TRUE, then you only get the rows that are contained in both datasets. -- View this message in context: http://r.789

Re: [R] dump not evaluating promises?

2010-04-30 Thread D Sonderegger
dump and dput but have the same behavior but dump has an extra option 'evaluate'. From the documentation, 'evaluate=TRUE' looks like it should force promises to be evaluated, ie convert 1:6 to be c(1,2,3,4,5,6). I think that either my understanding of what a 'promise' is and what it means to be

Re: [R] dump not evaluating promises?

2010-04-29 Thread D Sonderegger
What I was expecting was for the second dump was: foo <- structure(c(1,2,3,4,5,6), .Dim = c(2L, 3L)) That is, I was expecting dump to expand the 1:6 and 2:3 into the actual vectors. -- View this message in context: http://r.789695.n4.nabble.com/dump-not-evaluating-promises-tp2075859p2076059.

Re: [R] how to parse out fitting statistics and write them into a data frame?

2010-04-29 Thread D Sonderegger
> however, the result is a list and i do not know whether more model fitting > statistics (like p value of t test) is included in "result" or not. If i > print the first element of resut i got the followings: > The structure command is extremely helpful here. > str(result) will give you all t

[R] dump not evaluating promises?

2010-04-29 Thread D Sonderegger
I'm using the dump command to pass data to WinBUGS/OpenBUGS/JAGS and have run into a problem. Here is some R-code: foo <- array(1:6, dim=c(2,3)) dump('foo', file='dumpdata.R') dump('foo', file='dumpdata.R', append=TRUE, evaluate=TRUE) foo2 <- array(c(2,3,5,7,9,7,5,3), dim=c(2,4)) dump('foo2', fil

Re: [R] Smoothing Spline Basis Matrix

2010-03-01 Thread D Sonderegger
I can't recommend that book highly enough. Derek pinkdd wrote: > > Thank you. D Sonderegger. > Did you mean use > > bs <- bs(X, knots = spl$fit$knot) > H <- predict(bs, X) > > Then H should be the matrix for the original data under the smoothing > spline ba

Re: [R] Smoothing Spline Basis Matrix

2010-03-01 Thread D Sonderegger
I believe that smooth.spline fits a cubic B-spline to the data. So you just need to know the knot points (which are returned by smooth.spline as spl$fit$knot) and then use the bs() function in the splines library. pinkdd wrote: > > Anybody knows how to generate the basis matrix for smoothing s

[R] What Bayesian Framework?

2010-02-28 Thread D Sonderegger
I have found myself doing a large amount of Bayesian analysis and I am uncertain what framework learn and I'm posing this question to get a sense of perspective. As I am doing a lot of applied work right now, I need to do a fair amount of "standard data analysis" (eg mixed models, glm, etc) but I