Closed MarijkeThoonen closed 6 months ago
I can't provide a definitive diagnosis without access to your source files. It seems that the values in the locality_id column are entirely numerical, which might be causing it to be parsed as an integer type. Since mc_read_data function expects the locality_id to be a character vector, you can try explicitly converting the values to characters.
ft$locality_id <- as.character(ft$locality_id)
# or
lt$locality_id <- as.character(lt$locality_id)
Next thing could be in NAs. From the output of mc_info() it seems you have a lot of missing values in your data. Step 300s is something I would be careful about with TOMST loggers. This step is not impossible, but definitely not default. It would be good to double check the NAs first.
Then in mc_agg() default parameter min_coverage = 1, that means if you aggregate to days and within the day you have one or more missing values you will get NA from aggregation. You can use lower min_coverage if this is suitable for your analysis e.g. min_coverage = 0.9 to allow 10 % missing values within each day.
You can upload here the example part of you TOMST file and we can investigate deeper.
Hi there, thaks for the tips. It works now. I provided step = 900 in the files table wich rules out the NA's. I allso noticed that the sensor name changes when you use mc_agg. i.e. tms.day <- mc_agg(tms, fun = "max", min_coverage = 0.9, period = "day") TMS_T1 becomes TMS_T1_max so you have to provide this when you plot p <- mc_plot_line(tms_day_max, filename = "lines.pdf", sensors = c("TMS_T3_max", "TMS_T2_max"), #watch out: sensor naam changes by using mc_agg )
Hi Marijke,
Good to see that it helps. Regarding the issue with the "renaming" - it was our deliberate choice to include the aggregation statistics into the variable name after the aggregation. We think that this way, the name of the aggregated variable is more informative (and it also serves as a warning for the user that she/he works with already aggregated variable).
Thanks. Maybe it's informative to write in this in the 'Discription' of mc_agg in the help?
Ok, good suggestion. We will do that. Thanks!
Actually it is already quite clearly written in help of mc_agg
mc_agg returns new sensors on the localities putting aggregation function in its name (TMS_T1 -> TMS_T1_max),
Hi, It's my first issue so pardon my perhaps unconventional way of charing this issue. Thanx in advance for treating this issue. I have a data-set with TMS4-loggers and can't generate an output with mc_agg. Here the output of my script: