im working in R to analyse some data and having trouble getting my output file (excel workbook) to correctly display the date in Aus format (DD/MM/YYYY). the input file is csv with sites and dates.
I've checked the excel dates in the input file are all Australian format with the * (adapts to local time format) and without the *. I've even tried making the excel format in US date/time thinking this should at least give the right output even if it's kind of in the wrong order.
#Coerce variables into useful types
Treated_LORs$DATE <- as.Date(Treated_LORs$DATE)
Treated_LORs[, 18:44] <- sapply(Treated_LORs[, 18:44], function(x) as.numeric(x))
#Remove empty rows if any
Treated_LORs <- Treated_LORs[apply(Treated_LORs, 1, function(x) any(!is.na(x))),]
#Create a list of split data frames, split by site and sampling year
split_Treated_LORs <- split(Treated_LORs, f=list(Treated_LORs$SITENAME, Treated_LORs$Sampling.Year), drop=TRUE)
#Run the [calculate_Daily_Average_RA_PAF_Categories_Option2] function from the sourced R script above
for(i in 1:length(split_Treated_LORs)){
calculate_Daily_Average_RA_PAF_Categories_Option2(split_Treated_LORs[[i]])
}
i expect the output to be in Australian date format (DD/MM/YYYY) but it looks to be swapped to US format, e.g. 11/10/2015 (11 Oct 2015) becomes 0011-10-20 which looks like it is reading the input date as YYYY/MM/DD. Please help!