4 datasets found
  1. Data and Code for "Climate impacts and adaptation in US dairy systems...

    • zenodo.org
    zip
    Updated Oct 22, 2021
    + more versions
    Share
    FacebookFacebook
    TwitterTwitter
    Email
    Click to copy link
    Link copied
    Close
    Cite
    Maria Gisbert-Queral; Maria Gisbert-Queral; Arne Henningsen; Arne Henningsen; Bo Markussen; Bo Markussen; Meredith T. Niles; Ermias Kebreab; Ermias Kebreab; Angela J. Rigden; Angela J. Rigden; Nathaniel D. Mueller; Nathaniel D. Mueller; Meredith T. Niles (2021). Data and Code for "Climate impacts and adaptation in US dairy systems 1981-2018" [Dataset]. http://doi.org/10.5281/zenodo.4818011
    Explore at:
    zipAvailable download formats
    Dataset updated
    Oct 22, 2021
    Dataset provided by
    Zenodohttp://zenodo.org/
    Authors
    Maria Gisbert-Queral; Maria Gisbert-Queral; Arne Henningsen; Arne Henningsen; Bo Markussen; Bo Markussen; Meredith T. Niles; Ermias Kebreab; Ermias Kebreab; Angela J. Rigden; Angela J. Rigden; Nathaniel D. Mueller; Nathaniel D. Mueller; Meredith T. Niles
    License

    Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
    License information was derived automatically

    Area covered
    United States
    Description

    This data and code archive provides all the files that are necessary to replicate the empirical analyses that are presented in the paper "Climate impacts and adaptation in US dairy systems 1981-2018" authored by Maria Gisbert-Queral, Arne Henningsen, Bo Markussen, Meredith T. Niles, Ermias Kebreab, Angela J. Rigden, and Nathaniel D. Mueller and published in 'Nature Food' (2021, DOI: 10.1038/s43016-021-00372-z). The empirical analyses are entirely conducted with the "R" statistical software using the add-on packages "car", "data.table", "dplyr", "ggplot2", "grid", "gridExtra", "lmtest", "lubridate", "magrittr", "nlme", "OneR", "plyr", "pracma", "quadprog", "readxl", "sandwich", "tidyr", "usfertilizer", and "usmap". The R code was written by Maria Gisbert-Queral and Arne Henningsen with assistance from Bo Markussen. Some parts of the data preparation and the analyses require substantial amounts of memory (RAM) and computational power (CPU). Running the entire analysis (all R scripts consecutively) on a laptop computer with 32 GB physical memory (RAM), 16 GB swap memory, an 8-core Intel Xeon CPU E3-1505M @ 3.00 GHz, and a GNU/Linux/Ubuntu operating system takes around 11 hours. Running some parts in parallel can speed up the computations but bears the risk that the computations terminate when two or more memory-demanding computations are executed at the same time.

    This data and code archive contains the following files and folders:

    * README
    Description: text file with this description

    * flowchart.pdf
    Description: a PDF file with a flow chart that illustrates how R scripts transform the raw data files to files that contain generated data sets and intermediate results and, finally, to the tables and figures that are presented in the paper.

    * runAll.sh
    Description: a (bash) shell script that runs all R scripts in this data and code archive sequentially and in a suitable order (on computers with a "bash" shell such as most computers with MacOS, GNU/Linux, or Unix operating systems)

    * Folder "DataRaw"
    Description: folder for raw data files
    This folder contains the following files:

    - DataRaw/COWS.xlsx
    Description: MS-Excel file with the number of cows per county
    Source: USDA NASS Quickstats
    Observations: All available counties and years from 2002 to 2012

    - DataRaw/milk_state.xlsx
    Description: MS-Excel file with average monthly milk yields per cow
    Source: USDA NASS Quickstats
    Observations: All available states from 1981 to 2018

    - DataRaw/TMAX.csv
    Description: CSV file with daily maximum temperatures
    Source: PRISM Climate Group (spatially averaged)
    Observations: All counties from 1981 to 2018

    - DataRaw/VPD.csv
    Description: CSV file with daily maximum vapor pressure deficits
    Source: PRISM Climate Group (spatially averaged)
    Observations: All counties from 1981 to 2018

    - DataRaw/countynamesandID.csv
    Description: CSV file with county names, state FIPS codes, and county FIPS codes
    Source: US Census Bureau
    Observations: All counties

    - DataRaw/statecentroids.csv
    Descriptions: CSV file with latitudes and longitudes of state centroids
    Source: Generated by Nathan Mueller from Matlab state shapefiles using the Matlab "centroid" function
    Observations: All states

    * Folder "DataGenerated"
    Description: folder for data sets that are generated by the R scripts in this data and code archive. In order to reproduce our entire analysis 'from scratch', the files in this folder should be deleted. We provide these generated data files so that parts of the analysis can be replicated (e.g., on computers with insufficient memory to run all parts of the analysis).

    * Folder "Results"
    Description: folder for intermediate results that are generated by the R scripts in this data and code archive. In order to reproduce our entire analysis 'from scratch', the files in this folder should be deleted. We provide these intermediate results so that parts of the analysis can be replicated (e.g., on computers with insufficient memory to run all parts of the analysis).

    * Folder "Figures"
    Description: folder for the figures that are generated by the R scripts in this data and code archive and that are presented in our paper. In order to reproduce our entire analysis 'from scratch', the files in this folder should be deleted. We provide these figures so that people who replicate our analysis can more easily compare the figures that they get with the figures that are presented in our paper. Additionally, this folder contains CSV files with the data that are required to reproduce the figures.

    * Folder "Tables"
    Description: folder for the tables that are generated by the R scripts in this data and code archive and that are presented in our paper. In order to reproduce our entire analysis 'from scratch', the files in this folder should be deleted. We provide these tables so that people who replicate our analysis can more easily compare the tables that they get with the tables that are presented in our paper.

    * Folder "logFiles"
    Description: the shell script runAll.sh writes the output of each R script that it runs into this folder. We provide these log files so that people who replicate our analysis can more easily compare the R output that they get with the R output that we got.

    * PrepareCowsData.R
    Description: R script that imports the raw data set COWS.xlsx and prepares it for the further analyses

    * PrepareWeatherData.R
    Description: R script that imports the raw data sets TMAX.csv, VPD.csv, and countynamesandID.csv, merges these three data sets, and prepares the data for the further analyses

    * PrepareMilkData.R
    Description: R script that imports the raw data set milk_state.xlsx and prepares it for the further analyses

    * CalcFrequenciesTHI_Temp.R
    Description: R script that calculates the frequencies of days with the different THI bins and the different temperature bins in each month for each state

    * CalcAvgTHI.R
    Description: R script that calculates the average THI in each state

    * PreparePanelTHI.R
    Description: R script that creates a state-month panel/longitudinal data set with exposure to the different THI bins

    * PreparePanelTemp.R
    Description: R script that creates a state-month panel/longitudinal data set with exposure to the different temperature bins

    * PreparePanelFinal.R
    Description: R script that creates the state-month panel/longitudinal data set with all variables (e.g., THI bins, temperature bins, milk yield) that are used in our statistical analyses

    * EstimateTrendsTHI.R
    Description: R script that estimates the trends of the frequencies of the different THI bins within our sampling period for each state in our data set

    * EstimateModels.R
    Description: R script that estimates all model specifications that are used for generating results that are presented in the paper or for comparing or testing different model specifications

    * CalcCoefStateYear.R
    Description: R script that calculates the effects of each THI bin on the milk yield for all combinations of states and years based on our 'final' model specification

    * SearchWeightMonths.R
    Description: R script that estimates our 'final' model specification with different values of the weight of the temporal component relative to the weight of the spatial component in the temporally and spatially correlated error term

    * TestModelSpec.R
    Description: R script that applies Wald tests and Likelihood-Ratio tests to compare different model specifications and creates Table S10

    * CreateFigure1a.R
    Description: R script that creates subfigure a of Figure 1

    * CreateFigure1b.R
    Description: R script that creates subfigure b of Figure 1

    * CreateFigure2a.R
    Description: R script that creates subfigure a of Figure 2

    * CreateFigure2b.R
    Description: R script that creates subfigure b of Figure 2

    * CreateFigure2c.R
    Description: R script that creates subfigure c of Figure 2

    * CreateFigure3.R
    Description: R script that creates the subfigures of Figure 3

    * CreateFigure4.R
    Description: R script that creates the subfigures of Figure 4

    * CreateFigure5_TableS6.R
    Description: R script that creates the subfigures of Figure 5 and Table S6

    * CreateFigureS1.R
    Description: R script that creates Figure S1

    * CreateFigureS2.R
    Description: R script that creates Figure S2

    * CreateTableS2_S3_S7.R
    Description: R script that creates Tables S2, S3, and S7

    * CreateTableS4_S5.R
    Description: R script that creates Tables S4 and S5

    * CreateTableS8.R
    Description: R script that creates Table S8

    * CreateTableS9.R
    Description: R script that creates Table S9

  2. q

    Investigating human impacts on stream ecology: Intro to R

    • qubeshub.org
    Updated May 16, 2019
    Share
    FacebookFacebook
    TwitterTwitter
    Email
    Click to copy link
    Link copied
    Close
    Cite
    Kristen Kaczynski (2019). Investigating human impacts on stream ecology: Intro to R [Dataset]. http://doi.org/10.25334/Q45M9H
    Explore at:
    Dataset updated
    May 16, 2019
    Dataset provided by
    QUBES
    Authors
    Kristen Kaczynski
    Description

    This resource uses the Human Impact on Stream Ecology data set, background and questions and provides students an very general introduction to using R. Students perform basic summary statistics and data visualization in R (using tidyr language).

  3. H

    Time-Series Matrix (TSMx): A visualization tool for plotting multiscale...

    • dataverse.harvard.edu
    Updated Jul 8, 2024
    Share
    FacebookFacebook
    TwitterTwitter
    Email
    Click to copy link
    Link copied
    Close
    Cite
    Georgios Boumis; Brad Peter (2024). Time-Series Matrix (TSMx): A visualization tool for plotting multiscale temporal trends [Dataset]. http://doi.org/10.7910/DVN/ZZDYM9
    Explore at:
    CroissantCroissant is a format for machine-learning datasets. Learn more about this at mlcommons.org/croissant.
    Dataset updated
    Jul 8, 2024
    Dataset provided by
    Harvard Dataverse
    Authors
    Georgios Boumis; Brad Peter
    License

    CC0 1.0 Universal Public Domain Dedicationhttps://creativecommons.org/publicdomain/zero/1.0/
    License information was derived automatically

    Description

    Time-Series Matrix (TSMx): A visualization tool for plotting multiscale temporal trends TSMx is an R script that was developed to facilitate multi-temporal-scale visualizations of time-series data. The script requires only a two-column CSV of years and values to plot the slope of the linear regression line for all possible year combinations from the supplied temporal range. The outputs include a time-series matrix showing slope direction based on the linear regression, slope values plotted with colors indicating magnitude, and results of a Mann-Kendall test. The start year is indicated on the y-axis and the end year is indicated on the x-axis. In the example below, the cell in the top-right corner is the direction of the slope for the temporal range 2001–2019. The red line corresponds with the temporal range 2010–2019 and an arrow is drawn from the cell that represents that range. One cell is highlighted with a black border to demonstrate how to read the chart—that cell represents the slope for the temporal range 2004–2014. This publication entry also includes an excel template that produces the same visualizations without a need to interact with any code, though minor modifications will need to be made to accommodate year ranges other than what is provided. TSMx for R was developed by Georgios Boumis; TSMx was originally conceptualized and created by Brad G. Peter in Microsoft Excel. Please refer to the associated publication: Peter, B.G., Messina, J.P., Breeze, V., Fung, C.Y., Kapoor, A. and Fan, P., 2024. Perspectives on modifiable spatiotemporal unit problems in remote sensing of agriculture: evaluating rice production in Vietnam and tools for analysis. Frontiers in Remote Sensing, 5, p.1042624. https://www.frontiersin.org/journals/remote-sensing/articles/10.3389/frsen.2024.1042624 TSMx sample chart from the supplied Excel template. Data represent the productivity of rice agriculture in Vietnam as measured via EVI (enhanced vegetation index) from the NASA MODIS data product (MOD13Q1.V006). TSMx R script: # import packages library(dplyr) library(readr) library(ggplot2) library(tibble) library(tidyr) library(forcats) library(Kendall) options(warn = -1) # disable warnings # read data (.csv file with "Year" and "Value" columns) data <- read_csv("EVI.csv") # prepare row/column names for output matrices years <- data %>% pull("Year") r.names <- years[-length(years)] c.names <- years[-1] years <- years[-length(years)] # initialize output matrices sign.matrix <- matrix(data = NA, nrow = length(years), ncol = length(years)) pval.matrix <- matrix(data = NA, nrow = length(years), ncol = length(years)) slope.matrix <- matrix(data = NA, nrow = length(years), ncol = length(years)) # function to return remaining years given a start year getRemain <- function(start.year) { years <- data %>% pull("Year") start.ind <- which(data[["Year"]] == start.year) + 1 remain <- years[start.ind:length(years)] return (remain) } # function to subset data for a start/end year combination splitData <- function(end.year, start.year) { keep <- which(data[['Year']] >= start.year & data[['Year']] <= end.year) batch <- data[keep,] return(batch) } # function to fit linear regression and return slope direction fitReg <- function(batch) { trend <- lm(Value ~ Year, data = batch) slope <- coefficients(trend)[[2]] return(sign(slope)) } # function to fit linear regression and return slope magnitude fitRegv2 <- function(batch) { trend <- lm(Value ~ Year, data = batch) slope <- coefficients(trend)[[2]] return(slope) } # function to implement Mann-Kendall (MK) trend test and return significance # the test is implemented only for n>=8 getMann <- function(batch) { if (nrow(batch) >= 8) { mk <- MannKendall(batch[['Value']]) pval <- mk[['sl']] } else { pval <- NA } return(pval) } # function to return slope direction for all combinations given a start year getSign <- function(start.year) { remaining <- getRemain(start.year) combs <- lapply(remaining, splitData, start.year = start.year) signs <- lapply(combs, fitReg) return(signs) } # function to return MK significance for all combinations given a start year getPval <- function(start.year) { remaining <- getRemain(start.year) combs <- lapply(remaining, splitData, start.year = start.year) pvals <- lapply(combs, getMann) return(pvals) } # function to return slope magnitude for all combinations given a start year getMagn <- function(start.year) { remaining <- getRemain(start.year) combs <- lapply(remaining, splitData, start.year = start.year) magns <- lapply(combs, fitRegv2) return(magns) } # retrieve slope direction, MK significance, and slope magnitude signs <- lapply(years, getSign) pvals <- lapply(years, getPval) magns <- lapply(years, getMagn) # fill-in output matrices dimension <- nrow(sign.matrix) for (i in 1:dimension) { sign.matrix[i, i:dimension] <- unlist(signs[i]) pval.matrix[i, i:dimension] <- unlist(pvals[i]) slope.matrix[i, i:dimension] <- unlist(magns[i]) } sign.matrix <-...

  4. Gene Expression DEconvolution Pipeline in R

    • figshare.com
    application/gzip
    Updated Aug 31, 2021
    Share
    FacebookFacebook
    TwitterTwitter
    Email
    Click to copy link
    Link copied
    Close
    Cite
    Slim Karkar (2021). Gene Expression DEconvolution Pipeline in R [Dataset]. http://doi.org/10.6084/m9.figshare.16545708.v1
    Explore at:
    application/gzipAvailable download formats
    Dataset updated
    Aug 31, 2021
    Dataset provided by
    Figsharehttp://figshare.com/
    Authors
    Slim Karkar
    License

    Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
    License information was derived automatically

    Description

    gedepir is an R package that simplifies the use of deconvolution tools within a complete transcriptomics analysis pipeline. It simplify the definition of a end-to-end analysis pipeline with a set of base functions that are connected through the pipe syntax used in magrittr, tidyr or dplyr packages.This dataset example is comprised of 50 pseudo-bulk samples.

  5. Not seeing a result you expected?
    Learn how you can add new datasets to our index.

Share
FacebookFacebook
TwitterTwitter
Email
Click to copy link
Link copied
Close
Cite
Maria Gisbert-Queral; Maria Gisbert-Queral; Arne Henningsen; Arne Henningsen; Bo Markussen; Bo Markussen; Meredith T. Niles; Ermias Kebreab; Ermias Kebreab; Angela J. Rigden; Angela J. Rigden; Nathaniel D. Mueller; Nathaniel D. Mueller; Meredith T. Niles (2021). Data and Code for "Climate impacts and adaptation in US dairy systems 1981-2018" [Dataset]. http://doi.org/10.5281/zenodo.4818011
Organization logo

Data and Code for "Climate impacts and adaptation in US dairy systems 1981-2018"

Explore at:
2 scholarly articles cite this dataset (View in Google Scholar)
zipAvailable download formats
Dataset updated
Oct 22, 2021
Dataset provided by
Zenodohttp://zenodo.org/
Authors
Maria Gisbert-Queral; Maria Gisbert-Queral; Arne Henningsen; Arne Henningsen; Bo Markussen; Bo Markussen; Meredith T. Niles; Ermias Kebreab; Ermias Kebreab; Angela J. Rigden; Angela J. Rigden; Nathaniel D. Mueller; Nathaniel D. Mueller; Meredith T. Niles
License

Attribution 4.0 (CC BY 4.0)https://creativecommons.org/licenses/by/4.0/
License information was derived automatically

Area covered
United States
Description

This data and code archive provides all the files that are necessary to replicate the empirical analyses that are presented in the paper "Climate impacts and adaptation in US dairy systems 1981-2018" authored by Maria Gisbert-Queral, Arne Henningsen, Bo Markussen, Meredith T. Niles, Ermias Kebreab, Angela J. Rigden, and Nathaniel D. Mueller and published in 'Nature Food' (2021, DOI: 10.1038/s43016-021-00372-z). The empirical analyses are entirely conducted with the "R" statistical software using the add-on packages "car", "data.table", "dplyr", "ggplot2", "grid", "gridExtra", "lmtest", "lubridate", "magrittr", "nlme", "OneR", "plyr", "pracma", "quadprog", "readxl", "sandwich", "tidyr", "usfertilizer", and "usmap". The R code was written by Maria Gisbert-Queral and Arne Henningsen with assistance from Bo Markussen. Some parts of the data preparation and the analyses require substantial amounts of memory (RAM) and computational power (CPU). Running the entire analysis (all R scripts consecutively) on a laptop computer with 32 GB physical memory (RAM), 16 GB swap memory, an 8-core Intel Xeon CPU E3-1505M @ 3.00 GHz, and a GNU/Linux/Ubuntu operating system takes around 11 hours. Running some parts in parallel can speed up the computations but bears the risk that the computations terminate when two or more memory-demanding computations are executed at the same time.

This data and code archive contains the following files and folders:

* README
Description: text file with this description

* flowchart.pdf
Description: a PDF file with a flow chart that illustrates how R scripts transform the raw data files to files that contain generated data sets and intermediate results and, finally, to the tables and figures that are presented in the paper.

* runAll.sh
Description: a (bash) shell script that runs all R scripts in this data and code archive sequentially and in a suitable order (on computers with a "bash" shell such as most computers with MacOS, GNU/Linux, or Unix operating systems)

* Folder "DataRaw"
Description: folder for raw data files
This folder contains the following files:

- DataRaw/COWS.xlsx
Description: MS-Excel file with the number of cows per county
Source: USDA NASS Quickstats
Observations: All available counties and years from 2002 to 2012

- DataRaw/milk_state.xlsx
Description: MS-Excel file with average monthly milk yields per cow
Source: USDA NASS Quickstats
Observations: All available states from 1981 to 2018

- DataRaw/TMAX.csv
Description: CSV file with daily maximum temperatures
Source: PRISM Climate Group (spatially averaged)
Observations: All counties from 1981 to 2018

- DataRaw/VPD.csv
Description: CSV file with daily maximum vapor pressure deficits
Source: PRISM Climate Group (spatially averaged)
Observations: All counties from 1981 to 2018

- DataRaw/countynamesandID.csv
Description: CSV file with county names, state FIPS codes, and county FIPS codes
Source: US Census Bureau
Observations: All counties

- DataRaw/statecentroids.csv
Descriptions: CSV file with latitudes and longitudes of state centroids
Source: Generated by Nathan Mueller from Matlab state shapefiles using the Matlab "centroid" function
Observations: All states

* Folder "DataGenerated"
Description: folder for data sets that are generated by the R scripts in this data and code archive. In order to reproduce our entire analysis 'from scratch', the files in this folder should be deleted. We provide these generated data files so that parts of the analysis can be replicated (e.g., on computers with insufficient memory to run all parts of the analysis).

* Folder "Results"
Description: folder for intermediate results that are generated by the R scripts in this data and code archive. In order to reproduce our entire analysis 'from scratch', the files in this folder should be deleted. We provide these intermediate results so that parts of the analysis can be replicated (e.g., on computers with insufficient memory to run all parts of the analysis).

* Folder "Figures"
Description: folder for the figures that are generated by the R scripts in this data and code archive and that are presented in our paper. In order to reproduce our entire analysis 'from scratch', the files in this folder should be deleted. We provide these figures so that people who replicate our analysis can more easily compare the figures that they get with the figures that are presented in our paper. Additionally, this folder contains CSV files with the data that are required to reproduce the figures.

* Folder "Tables"
Description: folder for the tables that are generated by the R scripts in this data and code archive and that are presented in our paper. In order to reproduce our entire analysis 'from scratch', the files in this folder should be deleted. We provide these tables so that people who replicate our analysis can more easily compare the tables that they get with the tables that are presented in our paper.

* Folder "logFiles"
Description: the shell script runAll.sh writes the output of each R script that it runs into this folder. We provide these log files so that people who replicate our analysis can more easily compare the R output that they get with the R output that we got.

* PrepareCowsData.R
Description: R script that imports the raw data set COWS.xlsx and prepares it for the further analyses

* PrepareWeatherData.R
Description: R script that imports the raw data sets TMAX.csv, VPD.csv, and countynamesandID.csv, merges these three data sets, and prepares the data for the further analyses

* PrepareMilkData.R
Description: R script that imports the raw data set milk_state.xlsx and prepares it for the further analyses

* CalcFrequenciesTHI_Temp.R
Description: R script that calculates the frequencies of days with the different THI bins and the different temperature bins in each month for each state

* CalcAvgTHI.R
Description: R script that calculates the average THI in each state

* PreparePanelTHI.R
Description: R script that creates a state-month panel/longitudinal data set with exposure to the different THI bins

* PreparePanelTemp.R
Description: R script that creates a state-month panel/longitudinal data set with exposure to the different temperature bins

* PreparePanelFinal.R
Description: R script that creates the state-month panel/longitudinal data set with all variables (e.g., THI bins, temperature bins, milk yield) that are used in our statistical analyses

* EstimateTrendsTHI.R
Description: R script that estimates the trends of the frequencies of the different THI bins within our sampling period for each state in our data set

* EstimateModels.R
Description: R script that estimates all model specifications that are used for generating results that are presented in the paper or for comparing or testing different model specifications

* CalcCoefStateYear.R
Description: R script that calculates the effects of each THI bin on the milk yield for all combinations of states and years based on our 'final' model specification

* SearchWeightMonths.R
Description: R script that estimates our 'final' model specification with different values of the weight of the temporal component relative to the weight of the spatial component in the temporally and spatially correlated error term

* TestModelSpec.R
Description: R script that applies Wald tests and Likelihood-Ratio tests to compare different model specifications and creates Table S10

* CreateFigure1a.R
Description: R script that creates subfigure a of Figure 1

* CreateFigure1b.R
Description: R script that creates subfigure b of Figure 1

* CreateFigure2a.R
Description: R script that creates subfigure a of Figure 2

* CreateFigure2b.R
Description: R script that creates subfigure b of Figure 2

* CreateFigure2c.R
Description: R script that creates subfigure c of Figure 2

* CreateFigure3.R
Description: R script that creates the subfigures of Figure 3

* CreateFigure4.R
Description: R script that creates the subfigures of Figure 4

* CreateFigure5_TableS6.R
Description: R script that creates the subfigures of Figure 5 and Table S6

* CreateFigureS1.R
Description: R script that creates Figure S1

* CreateFigureS2.R
Description: R script that creates Figure S2

* CreateTableS2_S3_S7.R
Description: R script that creates Tables S2, S3, and S7

* CreateTableS4_S5.R
Description: R script that creates Tables S4 and S5

* CreateTableS8.R
Description: R script that creates Table S8

* CreateTableS9.R
Description: R script that creates Table S9

Search
Clear search
Close search
Google apps
Main menu