###################################################################
############### Module 6, Basics of data wrangling ################
###################################################################
## Lesson 13, Part 2: Reshaping your data and some other useful functions (reshaping)

# First load the tidyverse packages and then 
# upload the saved dataframe from the last part:
library(tidyverse)
covers_converted <- read_csv("data/covers_converted.csv")

###################################
##### RESHAPING DATAFRAMES
# Data that are ready for analysis have three particular
# features based on Hadley Wickam--one of the great
# masters of R and lead developer on the tidyverse
# packages:
# 1) Every column is its own variable
# 2) Every row is one observation
# 3) Every cell is one value
# See https://vita.had.co.nz/papers/tidy-data.pdf




island_soil <- read_csv("data/island_soil_data_raw.csv")
island_spatial <- read_csv("data/island_spatial_data_raw.csv")


###################################
##### SUMMARY
# - reshaping our dataframe using the pivot_wider function to
#   make each row become one species X site observation with values
#   for both understory and overstory cover

