Quick Start

Installing R

Since cydr is an R package, the first step in using cydr is to install R from the comprehensive R archive network (CRAN). To do this, go to CRAN and click the download link for the operating system you are using on your machine.

Installing RStudio

Next, it is highly recommended that you install RStudio, the integrated development environment (IDE) built for R. RStudio provides a suite of useful features which include syntax highlighing, integration with Rmarkdown, and a debugger. Download and install from RStudio.

Installing cydr

Since cydr is not yet available on CRAN, you must instead download it from its GitHub repository. When you download and install cydr all required libraries will also be downloaded, including dplyr. To download cydr from GitHub, follow the steps below.

  1. Download & install the devtools package from CRAN.

    install.packages("devtools")
    
  2. Load the devtools package into your workspace.

    library(devtools)
    
  3. Download & install cydr from GitHub using devtools

    devtools::install_github("jillianderson8/cydr")
    
  4. Load cydr into your workspace.

    library(cydr)
    

Importing data

Yield data is often stored in a variety of formats from proprietary Shapefiles to CSVs. However, cydr requires inputted data to be in the form of data frames. Data frames are the built-in structure for storing tabular data within R. Each data frame contains a header row containing column names. All subsequent rows contain observations.

This means that to use cydr you must first load your data into a data frame within R. Base R and other packages contain conversion and loading functions for a wide variety of file types. Further, there are many resources online for how to load specific file types into R data frames. For convenience, I have included a table below which includes the packages and functions which can be used to convert five common file formats to data frames. Each of these functions have their own documentation which can be referred to for assistance.

File Format Package Function Provided in Base R?
Plain Text utils read.table() Y
CSV utils read.csv() Y
Excel Spreadsheet gdata read.xls() N
ESRI Shapefile rgdal readOGR() N