[R] Extracting data and saving in excel
Rui Barradas
ru|pb@rr@d@@ @end|ng |rom @@po@pt
Fri Oct 23 18:19:46 CEST 2020
Hello,
First coerce the column birth to class Date, then subset.
data$birth <- as.Date(data$birth)
i <- data$birth > as.Date("1979-01-01")
subdata <- data[i, ]
To write back to Excel, use write.csv or a package able to write Excel
files directly.
Hope this helps,
Rui Barradas
Às 12:23 de 23/10/20, bgnumis bgnum escreveu:
> Hi all,
>
> I have a dataframe call "data", and have lots of rows. One of them
> is data$`birth`
> my data has been imported from an excel file in RSTUDIO
>
> I want to obtain in a function all rows (with the names) where
> data$`birth` is bigger than 1979/01/01 and extract in a excel file as an
> output (a sub-excel of the original).
>
> Can you guide with the functions I need to use?
>
> I have been many time out of programming and I need a bit of help to get in
> fit.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list