[R] lib default location

2016-05-21 Thread Alba Pompeo
Everytime I install a package from CRAN I receive this message: Installing package into ‘/home/albap/R/x86_64-pc-linux-gnu-library/3.3’ (as ‘lib’ is unspecified) Should I set my lib? If so, what's the recommended path? Also, everytime I have to choose the mirror. Could I make one of them

[R] An averaged model based on Quartile and Mean of Quartiles

2016-05-21 Thread ch.elahe via R-help
Hi all, Here is my df and I want to make an averaged model of my variables based on Time like the following: $ Protocol : Factor w/ 48 levels "DP FS QTSE SAG",..: 2 3 43 42 $ Time : num 182 185 189 234 186 ... $ Systemtype : Factor w/ 2 levels "Aera XJ","AERA XQ": 1

Re: [R] lib default location

2016-05-21 Thread Uwe Ligges
On 21.05.2016 14:49, Alba Pompeo wrote: Everytime I install a package from CRAN I receive this message: Installing package into ‘/home/albap/R/x86_64-pc-linux-gnu-library/3.3’ (as ‘lib’ is unspecified) Should I set my lib? If so, what's the recommended path? It is fine to keep this per

Re: [R] An averaged model based on Quartile and Mean of Quartiles

2016-05-21 Thread David Winsemius
> On May 21, 2016, at 7:41 AM, ch.elahe via R-help wrote: > > Hi all, > > Here is my df and I want to make an averaged model of my variables based on > Time like the following: > > > $ Protocol : Factor w/ 48 levels "DP FS QTSE SAG",..: 2 3 43 42 > $ Time

Re: [R] Matrix multiplications

2016-05-21 Thread Roy Mendelssohn - NOAA Federal
> str(t(y-X %*% b)) num [1, 1:10] 0.595 -1.7538 -0.0498 -1.651 -0.6328 ... > str((y-X %*% b)) num [1:10, 1] 0.595 -1.7538 -0.0498 -1.651 -0.6328 … -Roy > On May 21, 2016, at 12:00 PM, george brida wrote: > > Dear R users: > > I have written the following lines : >

Re: [R] Matrix multiplications

2016-05-21 Thread peter dalgaard
I don't know if there is some sort of propagation delay, but the reason has already been given and multiple fixes suggested. -pd > On 21 May 2016, at 21:26 , george brida wrote: > > Roy, > > Yes, t(y-X %*% b) is the transpose of y-X %*% b. In principle the product >

Re: [R] Matrix multiplications

2016-05-21 Thread peter dalgaard
> On 21 May 2016, at 21:00 , george brida wrote: > > Dear R users: > > I have written the following lines : > >> x=c(10,11,12,13,14,17,15,16,10,11,41,25,26,14,12,14,15,20,14,22) >> x=matrix(x,ncol=2) >> a=matrix(1,nrow(x),1) >> X=cbind(a,x) >> y=c(12.00, 11.00, 13.00,

[R] Matrix multiplications

2016-05-21 Thread george brida
Dear R users: I have written the following lines : >x=c(10,11,12,13,14,17,15,16,10,11,41,25,26,14,12,14,15,20,14,22) > x=matrix(x,ncol=2) > a=matrix(1,nrow(x),1) > X=cbind(a,x) >y=c(12.00, 11.00, 13.00, 12.50, 14.00, 18.50, 15.00, 12.50, 13.75, 15.00) >b=solve(t(X)%*% X)%*% t(X)%*% y when I

Re: [R] Matrix multiplications

2016-05-21 Thread george brida
Roy, Yes, t(y-X %*% b) is the transpose of y-X %*% b. In principle the product of t(y-X %*% b) *(y-X %*% b) is a scalar, I don't know why I have an error message after the following line: (t(y-X %*% b)%*%(y-X %*% b)/(length(y)-ncol(X)))*solve(t(X)%*% X) Thanks On Sat, May 21, 2016 at 9:10

Re: [R] lib default location

2016-05-21 Thread Rolf Turner
On 22/05/16 01:54, Uwe Ligges wrote: On 21.05.2016 14:49, Alba Pompeo wrote: Everytime I install a package from CRAN I receive this message: Installing package into ‘/home/albap/R/x86_64-pc-linux-gnu-library/3.3’ (as ‘lib’ is unspecified) Should I set my lib? If so, what's the recommended

Re: [R] An averaged model based on Quartile and Mean of Quartiles

2016-05-21 Thread Ulrik Stervbo
Hi Chalabi, Maybe you can use ddply to look over the intervals and add the means as new colum Best wishes Ulrik David Winsemius schrieb am Sa., 21. Mai 2016 17:16: > > > On May 21, 2016, at 7:41 AM, ch.elahe via R-help > wrote: > > > > Hi all, >

Re: [R] lib default location

2016-05-21 Thread Alba Pompeo
Nice alternative solution. Thanks Rolf. On Sat, May 21, 2016 at 6:30 PM, Rolf Turner wrote: > On 22/05/16 01:54, Uwe Ligges wrote: >> >> >> >> On 21.05.2016 14:49, Alba Pompeo wrote: >>> >>> Everytime I install a package from CRAN I receive this message: >>> >>>

Re: [R] Matrix multiplications

2016-05-21 Thread george brida
Thank you very much Peter. On Sat, May 21, 2016 at 9:18 PM, peter dalgaard wrote: > > > On 21 May 2016, at 21:00 , george brida wrote: > > > > Dear R users: > > > > I have written the following lines : > > > >>

[R] Choosing rows

2016-05-21 Thread oslo via R-help
Hi all; I have a big data set (a small part is given below) and V1 column has repeated info in it. That is rs941873, rs12307687... are repeating many times. I need choose only one SNP (in first column named rs) which has the smallest  Pvalue withing V1 column. That is I need choose only one SNP