Hello,
I have kind of an odd request to manipulate a dataframe. I'm tweaking a list input files for a box model within R. I'm creating a list of files from my directory, dividing all the values (except time) by 60.
files<-list.files(pattern = "^MOZART(.*)conc", full.names = FALSE)
Mozart<-lapply(files, FUN = function(x){
read.table(x, header = TRUE, sep = "")})
NewList<-map(Mozart, function(x){
x%>%
mutate(across(everything(), ~./60))%>%
mutate(time = time*60)
})
Code there is simple enough. However, I need the dataframe that I end up writing to have format like this:
45
0
2
time H2O CO2 CH2O
0 10 11 222
Basically I need to add those three numbers to the top of each dataframe. They aren't supposed to be rows or columns, just numbers. Is there any way of doing this. Any help is greatly appreciated.