ibot-geoecology / myClim

R package for processing microclimatic data
GNU General Public License v2.0
6 stars 3 forks source link

problem joining data from logger in the same location #7

Closed SusaREche closed 6 months ago

SusaREche commented 10 months ago

Hi there!

I have TOMST data from 10 localities with 1 logger in each location and data from 2 different times for each logger. I have tried to join data for each logger using mc_join but it doesn't work. I am attaching the datafiles for one logger. data_94216601_6.csv data_94216601_7.csv

I used this code: library(myClim) library(stringr) tms <- mc_read_files(".", dataformat_name = "TOMST", recursive = F, silent = T) mc_info_clean(tms) #returning the data frame with cleaning log mc_info_count(tms) #which returns the number of localities, loggers and sensors in myClim object mc_info(tms) mc_join(tms, comp_sensors = NULL)

Output of my SessionInfo() from R:

sessionInfo() R version 4.2.2 (2022-10-31) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS High Sierra 10.13.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] stringr_1.4.1 myClim_1.0.1

loaded via a namespace (and not attached): [1] rstudioapi_0.14 magrittr_2.0.3 tidyselect_1.1.2 munsell_0.5.0 colorspace_2.1-0 R6_2.5.1
[7] rlang_1.0.6 fansi_1.0.4 dplyr_1.0.10 tools_4.2.2 grid_4.2.2 gtable_0.3.1
[13] xfun_0.33 tinytex_0.41 utf8_1.2.3 cli_3.6.0 DBI_1.1.3 assertthat_0.2.1 [19] tibble_3.2.0 lifecycle_1.0.3 purrr_0.3.4 ggplot2_3.4.1 vctrs_0.5.2 glue_1.6.2
[25] stringi_1.7.8 compiler_4.2.2 pillar_1.8.1 generics_0.1.3 scales_1.2.1 pkgconfig_2.0.3

martin-kopecky commented 10 months ago

Please, see previous response here: https://github.com/ibot-geoecology/myClim/issues/6

Jules- commented 10 months ago

SusanaRE commented in other issue

But I don't have the same problem. My tms object has the 2 readings (loggers) within each locality:

Screenshot 2023-11-16 at 16 57 35

Answer

The step size in the file data_94216601_6.csv is standard 15 minutes. But the step in the file data_94216601_7.csv is courious.

2023.06.22 14:45
2023.06.22 14:50
2023.06.22 15:00
2023.06.22 15:10
2023.06.22 15:15
2023.06.22 15:20
2023.06.22 15:30
2023.06.22 15:40
2023.06.22 15:45
2023.06.22 15:50
2023.06.22 16:00
2023.06.22 16:10
2023.06.22 16:15
2023.06.22 16:20
2023.06.22 16:30
2023.06.22 16:40
...

myClim detected step size 5 minutes. The mc_join() function can only join loggers with the same step size.

To solve this problem, you can define the step size as 15 minutes in the mc_read_files() function. This will cause some values to be deleted in the cleaning process.

tms <- mc_read_files(".", dataformat_name = "TOMST", recursive = F, silent = T, step=15*60)