Re: [R] Get data from a list of data frames

2022-12-22 Thread Stefano Sofia
-oO Da: Bert Gunter Inviato: giovedì 15 dicembre 2022 18:31 A: Gerrit Eichner; Stefano Sofia Cc: r-help@r-project.org Oggetto: Re: [R] Get data from a list of data frames Well, just for giggles, Gerrit's sol

Re: [R] Get data from a list of data frames (Stefano Sofia)

2022-12-16 Thread Bert Gunter
. > > From: R-help on behalf of > r-help-requ...@r-project.org > Date: Friday, 16December, 2022 at 05:00 > To: r-help@r-project.org > Subject: [EXTERNAL] R-help Digest, Vol 238, Issue 16 > > Message: 1 > Date: Thu, 15 Dec 2022 13:52:35 +0000 > From: Stefano Sofia

Re: [R] Get data from a list of data frames (Stefano Sofia)

2022-12-16 Thread Jorgen Harmse via R-help
Sofia To: "r-help@R-project.org" Subject: [R] Get data from a list of data frames Message-ID: Content-Type: text/plain; charset="utf-8" Dear R-list users, I have a list of n data frames built as follows: Station1 <- data.frame(sensor = c("thermometer",

Re: [R] Get data from a list of data frames

2022-12-15 Thread Bert Gunter
Well, just for giggles, Gerrit's solution can be easily vectorized (i.e. no apply()-type stuff needed) IFF the structure of all the data frames are identical so that rbind() works: d <-do.call('rbind',Total[select.stat]) ## one data frame to combine them all ;-) d[d$sensor == 'thermometer','code']

Re: [R] Get data from a list of data frames

2022-12-15 Thread Gerrit Eichner
Hello, Stefano, maybe the following example contains what you want to achieve: Station1 <- data.frame(sensor = c("thermometer", "raingauge", "snowgauge", "anemometer"), code = c(2583, 1478, 3178, NA)) Station2 <- data.frame(sensor = c("thermometer", "raingauge", "snowga

[R] Get data from a list of data frames

2022-12-15 Thread Stefano Sofia
Dear R-list users, I have a list of n data frames built as follows: Station1 <- data.frame(sensor = c("thermometer", "raingauge", "snowgauge", "anemometer"), code = c(2583, 1478, 3178, NA)) Station2 <- data.frame(sensor = c("thermometer", "raingauge", "snowgauge", "anemometer"), code = c(2584,