On 04/11/2021 16:02, Rich Shepard wrote:
On Thu, 4 Nov 2021, Ben Tupper wrote:

                      )

The gzipped data file can be downloaded from <https://tinyurl.com/5usc8wbz>.


This seems to work fine for me:


library(readr)
cor_stage_file <- "cor-stage.csv"
cor_stage <- read_csv(cor_stage_file,
                      col_types = list(site_nbr = col_integer(),
                                       year = col_character(),
                                       mon = col_character(),
                                       day = col_character(),
                                       hr = col_character(),
                                       min = col_character(),
                                       tz = col_character(),
                                       ft = col_double()))

# Add a proper datetime column
date_string <- with(cor_stage, paste(year, mon, day, sep="-"))
time_string <- with(cor_stage, paste(hr, min, "00", sep=":"))
cor_stage['date_time'] <- as.POSIXct(paste(date_string, time_string, cor_stage$tz))

Why are you importing the last "ft" column as an integer when it's clearly decimal data?


--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918

______________________________________________
R-help@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.

Reply via email to