[R] Fatal error: unable to restore saved data in .RData --- no package called 'nlme'

2006-09-22 Thread michael papenfus
I am using Windows XP and R 2.3.1. During my lastest session I updated my packages and now when I try to start R 2.3.1 I get the following error message: Fatal error: unable to restore saved data in .RData in an error window and Error in loadNamespace(name): there is no package called 'nlme' in th

[R] Functions ,Optim, & Dataframe

2006-07-31 Thread Michael Papenfus
I think I need to clarify a little further on my original question. I have the following two rows of data: mydat<-data.frame(d1=c(3,5),d2=c(6,10),p1=c(.55,.05),p2=c(.85,.35)) >mydat d1 d2 p1 p2 1 3 6 0.55 0.85 2 5 10 0.05 0.35 I need to optimize the following function using optim for each row

[R] Functions ,Optim, & Dataframe

2006-07-30 Thread Michael Papenfus
I have defined the following function: fr<-function(x) { u<-x[1] v<-x[2] sqrt(sum((plnorm(c(3,6),u,v)-c(.55,.85))^2)) } which I then solve using optim y<-optim(c(1,1),fr) > y$par [1] 1.0029771 0.7610545 This works fine. Now I want to use these two steps on a dataframe: mydat<-data.

[R] Adding elements of matrices of different dimensions

2006-06-26 Thread michael papenfus
If I have two matrices: > a<-matrix(1:5,ncol=1) [,1] [1,]1 [2,]2 [3,]3 [4,]4 [5,]5 > b<-matrix(1:50,ncol=10) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]16 11 16 21 26 31 36 4146 [2,]27 12 17 22 27 32 37 42