Re: [R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-21 Thread Ioannou, Ioanna
aforementioned two. In fact, the third is identical to the first. Could you please optimize? Thank you very much again, Best, ioanna -Original Message- From: Jim Lemon [mailto:drjimle...@gmail.com] Sent: Friday, December 20, 2019 9:04 PM To: Ioannou, Ioanna Cc: r-help mailing list Subject

Re: [R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-20 Thread Ioannou, Ioanna
check the code I sent last and based on that give your solution? Many thanks. Get Outlook for Android<https://aka.ms/ghei36> From: Jim Lemon Sent: Friday, December 20, 2019 11:40:28 AM To: Ioannou, Ioanna Cc: r-help mailing list Subject: Re: [R] How to cr

Re: [R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-20 Thread Ioannou, Ioanna
mp; DS2_rows,calc_vars] - D[calc_rows & DS3_rows,calc_vars]) + 0.43 * (D[calc_rows & DS3_rows,calc_vars] - D[calc_rows & DS4_rows,calc_vars]) + 1.0* D[calc_rows & DS4_rows,calc_vars] } } } -----Original Mes

[R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ioannou, Ioanna
Hello everyone, I have the following problem: I have a data.frame with multiple fields. If I had to do my calculations for a given combination of IM.type and Taxonomy is the following: D <- read.csv('Test_v2.csv') names(D) VC <- 0.01*( subset(D, IM.type == 'PGA' & Damage.state == 'DS1' & Taxono