Skip to content

Suspected problem with tidy data set #4

Description

@diatomdaniel

Hi all (and particularly @LinneaRock and project head-honcho @mcstreamy ),
I have discovered an issue re. the tidy version of the data set (i.e. all results in one column (RESULTS) with another column providing the variable name (VARIABLE): the data is not uniquely identified in this format. For example when I tried to pivot from a long to wide data format, duplicate entries per site and time are created that need to be summarised/averaged.
e.g. after loading the ALL_CNP_VARs data set, consider the following code (requires tidyverse package to be loaded)

master_wide <- ALL_CNP_VARS %>% pivot_wider(id_cols = c(DATE_COL, SITE_ID, UNIT, LAT, LON, ECO_TYPE), names_from = VARIABLE, values_from = RESULT)

compared to

master_wide <- ALL_CNP_VARS %>% pivot_wider(id_cols = c(DATE_COL, SITE_ID, UNIT, LAT, LON, ECO_TYPE), names_from = VARIABLE, values_from = RESULT, values_fn = mean)

I suspect this behaviour occurs because the date column is contains YY-MM-DD but not hourly information? Regardless, this is an issue we should address soon.
Please note that I am not trying to criticise previous work/efforts so far or the validity tidy data format; I just think this is a data issue we need to address for consistent results going forward....Also, maybe I am being an idiot and this is already accounted for. If so, please let me know.

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions