I am trying to read wave height data into R using this website
https://www.ndbc.noaa.gov/download_data.php?filename=51201h2017.txt.gz&dir=data/historical/stdmet/
my code is
buoy <- 51211
year <- 2017
one_yr <- paste0("https://www.ndbc.noaa.gov/view_text_file.php?filename=",
buoy, "h", year, ".txt.gz&dir=data/historical/stdmet/")
oneBuoy_oneYR.df <- read.csv(one_yr, fill = TRUE)
The resulting output is a data frame that has one column and 8985 observations. I have tried using sep = " "
but there are some columns that are separated with two spaces instead of one. I have also tried read.delim
I'm sure there is an easy solution, I just haven't found it.