Issues converting chr to POSIXct and watr.heat.map in lakeanalyzer

17 Views Asked by At

I am trying to create a water heat map (wtr.heat.map) using lake analyzer and I keep running into this error

Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : 
non-numeric argument to binary operator"

I believe it's because I'm having issues converting the datetimes in my csv from chr to POSIXct.

I have tried the following code

load dataset

getwd()
setwd("/Users/heathershaw/Desktop/DepthProfiles2023/TalusSouthHeatMaps")
TalusSouth <- read.csv( file = "HeatMapTS.csv")
View(TalusSouth)
str(TalusSouth)

datetime..GMT. <- as.POSIXct(TalusSouth$datetime..GMT., format = "%Y-%m-%d %H:%M:%S",
Tz="GMT")
datetime..GMT.

turn into a dataframe

TalusSouthdf<-as.data.frame(TalusSouth)

make a heat map

plot2<-wtr.heat.map (TalusSouthdf, plot.axes = {axis(1,
at = as.POSIXct(seq.Date(from = as.Date("2023-07-   06"),
to = as.Date("2023-10-05"),                                             
by = "1 week")),

labels = format(seq.Date(from = as.Date("2023-78-06"),
to = as.Date("2023-10-05"),
by = "1 week"),
"%b %d"))  
axis(2)} )
                                         
                                       
0

There are 0 best solutions below