[R] Select rows of a data frame according to values of vector in a list

2014-01-03 Thread Mohammad Tanvir Ahamed
Hi there !! I have a list like as follows :  lis $lis1 [1] 1 3 5  $lis2 [1] 2 4 6 8 9 I have another data frame like as follows  df 1 10 110 2 15 120 3 20 130 4 25 140 5 30 150 6 35 160 7 40 150 8 45 180 9 50 190 Now i want to select the rows of data frame by the value of list and the output

Re: [R] Select rows of a data frame according to values of vector in a list

2014-01-03 Thread Rui Barradas
Hello, Try the following. lapply(lis, function(i) df[i, ]) Hope this helps, Rui Barradas Em 03-01-2014 09:04, Mohammad Tanvir Ahamed escreveu: Hi there !! I have a list like as follows : lis $lis1 [1] 1 3 5 $lis2 [1] 2 4 6 8 9 I have another data frame like as follows df 1 10 110 2

Re: [R] Select rows of a data frame according to values of vector in a list

2014-01-03 Thread Mohammad Tanvir Ahamed
Thanks !!   Best regards ...  Tanvir Ahamed Göteborg, Sweden From: Rui Barradas ruipbarra...@sapo.pt -h...@r-project.org Sent: Friday, 3 January 2014, 10:58 Subject: Re: [R] Select rows of a data frame according to values of vector in

[R] Ordering the rows of a data frame

2014-01-03 Thread Stefano Sofia
Dear R users, I have two files of seasonal rainfall data (more than 10,000 rows each); here the first 8 rows of each file are reported. Code_Raingouge,Y_init,M_init,D_init,h_init,m_init,Y_fin,M_fin,D_fin,h_fin,m_fin,Rainfall,N_Values,Quality_Level,Code_Station

[R] Package LaplacesDemon information

2014-01-03 Thread Vittorio Colagrande
Dear R-group I can not install the package LaplacesDemon in version 3.0.2 of R. I ask whether it is possible or, alternatively, signs for a equivalent package. Thanks you and best regards. Vittorio Colagrande [[alternative HTML version deleted]]

Re: [R] Ordering the rows of a data frame

2014-01-03 Thread Ista Zahn
On Fri, Jan 3, 2014 at 9:41 AM, Stefano Sofia stefano.so...@regione.marche.it wrote: Dear R users, I have two files of seasonal rainfall data (more than 10,000 rows each); here the first 8 rows of each file are reported.

Re: [R] Ordering the rows of a data frame

2014-01-03 Thread Dmitry Pavlyuk
Hi Sofia! You need to attach the data file before sorting: attach(df_final) or just use full qualified names (like df_final$Y_init) Dmitry On 03/01/2014 16:41, Stefano Sofia wrote: Dear R users, I have two files of seasonal rainfall data (more than 10,000 rows each); here the first 8 rows

[R] Linear transformation of multivariate normal

2014-01-03 Thread Dmitry Pavlyuk
Hello, Colleges! I'm having a problem with illustration of linear transformation of multivariate gaussian RV using R. According to the theory, if X ~ N(0, I), then CX ~ N(0,CC'). But the code below doesn't illustrate this. Please could you help me to find a mistake require(tmvtnorm) C =

[R] multitaper power analysis

2014-01-03 Thread catalin roibu
Dear all, I have a big problem with R. I want to make a multitaper power spectrum analysis of a time series using 3 tapers and a resolution of two years with robust background noise estimation. I try different packages but unsuccessful. library(multitaper) d-spec.mtm(CAMstd, nw=2,

Re: [R] Ordering the rows of a data frame

2014-01-03 Thread Bert Gunter
Inline Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Fri, Jan 3, 2014 at 7:08 AM, Dmitry Pavlyuk dmitry.v.pavl...@gmail.com wrote: Hi Sofia! You need to

[R] (no subject)

2014-01-03 Thread tania dehesh
Hi I have a factor in two level and a continues variable nested in one of the factor A levels. Does it nested ancova model? Please guide me Regards, [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] APA two-way bar-chart

2014-01-03 Thread Benjamin Telkamp [via R]
Dear R-users, I'm struggling with APA formatted two way BAR-charts according to apa-style i should have the legend in the background of my plot (so above the bars and not beside the picture/plot itself) and the background should be completely white without gridlines or what so ever. Could any one

Re: [R] Ordering the rows of a data frame

2014-01-03 Thread Dmitry Pavlyuk
Bert, why do you think that attach is not working in this case? Did you check it before your advice? :) I agree about generally bad approach, but it is quite convenient for work with one data set. Dmitry On 03/01/2014 18:28, Bert Gunter wrote: Inline Bert Gunter Genentech Nonclinical

Re: [R] Ordering the rows of a data frame

2014-01-03 Thread Bert Gunter
You misunderstand = I was not sufficiently clear. What is false is your statement that you **need** to attach the data file before sorting. You do not. with()/within() can be used to avoid using the fully qualified names without attaching. I did not claim that attaching first would not work, only

Re: [R] Package LaplacesDemon information

2014-01-03 Thread David Winsemius
On Jan 3, 2014, at 6:45 AM, Vittorio Colagrande wrote: Dear R-group I can not install the package LaplacesDemon in version 3.0.2 of R. I ask whether it is possible or, alternatively, signs for a equivalent package. Thanks you and best regards. Vittorio Colagrande

[R] robust definition of \code{} for a knitr-produced document

2014-01-03 Thread Michael Friendly
[Not sure if I should post this here, or on a another list, but will try here first...] For a book I'm writing using knitr .Rnw files, I would like to use \code{} to mark *all* R code, without having to escape special characters that appear in R names, formulas, etc. In the past, I've use

Re: [R] R crashes with memory errors on a 256GB machine (and system shoes only 60GB usage)

2014-01-03 Thread Xebar Saram
Hi again and thank you all for the answers i need to add that im a relatively R neewb so i apologize in advance i started R with the --vanilla option and ran gc() this is the output i get: gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 182236 9.8 407500 21.8 35 18.7

Re: [R] Ordering the rows of a data frame

2014-01-03 Thread Dmitry Pavlyuk
Ah, ok, thank you for explanations! Dmitry On 03/01/2014 20:00, Bert Gunter wrote: You misunderstand = I was not sufficiently clear. What is false is your statement that you **need** to attach the data file before sorting. You do not. with()/within() can be used to avoid using the fully

[R] Permutation test with raster data

2014-01-03 Thread Stefan Mühlbauer
Hello!   I am having two variables x and y (whereas y is a set of raster images) and want to quantify the correlation between x and y by calculating the Pearson Correlation Coefficient. In order to ensure how signficant the correlation results are, I am interested in getting the p-value (0.1)

Re: [R] Permutation test with raster data

2014-01-03 Thread Rolf Turner
See in-line below. cheers, Rolf Turner On 04/01/14 12:48, Stefan Mühlbauer wrote: Hello! Â I am having two variables x and y (whereas y is a set of raster images) and want to quantify the correlation between x and y by calculating the Pearson Correlation Coefficient. In

[R] Unstack a dataframe using RCommander

2014-01-03 Thread David Arnold
Hi, Looking to see how to unstack a dataframe using RCommander. The dataset I'm using is: http://www.sagepub.com/dsur/study/DSUR%20Data%20Files/Chapter%209/SpiderLong.dat I want to use RCommander to change it to this form:

Re: [R] R crashes with memory errors on a 256GB machine (and system shoes only 60GB usage)

2014-01-03 Thread jim holtman
It would help to know the sizes of the objects that have in your workspace and also provide the 10 prior lines of your script at the point of the error so that we can see what you are trying to do. The following commands will list out the sizes of the objects: cbind(sapply(ls(), function(x){

[R] Parse character strings so they align (line up/match) properly

2014-01-03 Thread Joshua Banta
Dear listserv, I don't know if this question is more appropriate for the Bioconductor listserv or the general R listserv. I am asking it here because I believe this problem can be solved using regular R commands in the base package. I suspect you all will be very helpful. I have genetic

[R] p value of trends for odds ratios (or hazard ratios)

2014-01-03 Thread zhu yao
Dear Sir Many papers calculated the p value of trends for odds ratios of ordered category variables. I have found the tabodds command in Stata. But how to do it in R? Thanks *Yao Zhu* *Department of UrologyFudan University Shanghai Cancer CenterShanghai, China* [[alternative HTML

[R] [R-pkgs] caret version 6.0-21

2014-01-03 Thread Kuhn, Max
The caret package (short for Classification And REgression Training) attempts to streamline the process for creating predictive models. The package contains tools for: - data splitting - pre-processing - feature selection - model tuning using resampling (with parallel processing) - variable