Skip to content
Prev 382047 / 398502 Next

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

Just i case you cant see the data:

Test.v2 <- data.frame(Ref.No = c(1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629),
                      IM.type = c('PGA', 'PGA', 'PGA', 'PGA', 'Sa', 'Sa', 'Sa', 'Sa'),
                      Damage.state = c('DS1', 'DS2', 'DS3', 'DS4','DS1', 'DS2', 'DS3', 'DS4'),
                      Taxonomy = c('ER+ETR_H1','ER+ETR_H1','ER+ETR_H1','ER+ETR_H1','ER+ETR_H2','ER+ETR_H2','ER+ETR_H2','ER+ETR_H2'),
                      IM_1 = c(0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00),
                      IM_2 = c(0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08),
                      IM_3 = c(0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16),
                      IM_1 = c(0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24),
                      Prob.of.exceedance_1 = c(0,0,0,0,0,0,0,0),
                      Prob.of.exceedance_2 = c(0,0,0,0,0,0,0,0),
                      Prob.of.exceedance_3 = c(0.26,0.001,0.00019,0.000000573,0.04,0.00017,0.000215,0.000472),
                      Prob.of.exceedance_4 = c(0.72,0.03,0.008,0.000061,0.475,0.0007,0.00435,0.000405)
                      )
Message-ID: <DBBPR05MB6570179807B0FADFF29ADE61F3500@DBBPR05MB6570.eurprd05.prod.outlook.com>
In-Reply-To: <DBBPR05MB65704F2FE85F9BD5AF2ABF8AF3500@DBBPR05MB6570.eurprd05.prod.outlook.com>