I have a time series object and I am creating a list of the variables at different timesteps.
when I do apply.weekly( , mean) it works fine, but when I want to sum the values over a week it gives me..
Error in FUN(x[(INDEX[y] + 1):INDEX[y + 1]], …) :
invalid ‘type’ (character) of argument
I realise my xts object is all characters…
An xts object on 2016-11-10 / 2017-05-22 containing:
Data: character [194, 18]
Columns: dewpoint_temp_k, shortwave_radiation_max_jm2, shortwave_radiation_min_jm2, shortwave_radiation_sum_jm2, air_temp_k … with 13 more columns
Index: POSIXlt,POSIXt [194] (TZ: “US/Pacific”)
…even though I made sure they were numeric before I converted the dataframe to a timeseries object
I can’t seem to convert the xts column to numeric either, it just stays as character
Tatiana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.