Adding columns with reproductive calculations from the the field work.

Set up

rm(list=ls())

library(tidyverse)
library(ggpubr)
library(scales)
library(chron)
library(plotly)
library(taRifx)
library(aweek)
library(easypackages)
library(renv)
library(here)
library(ggthemes)
library(gridExtra)
library(patchwork)
library(tidyquant)
library(recipes) 
library(cranlogs)
library(knitr)
library(openair)

Setting up

#read in data
all<-read.csv(
      "https://raw.githubusercontent.com/Cmwegener/thesis/master/data/field/CB_field_data_10.12.2020.csv",
    header = TRUE
  )
#converting to date format
all$date<-as.Date(all$date, format = c("%m/%d/%Y"))

Calculations

#percent reproductive dry weight
all$perc.rdw<-(all$dw.repro/(all$dw.repro + all$dw.veg))*100

#percent vegetative dry weight
all$perc.vdw<-(all$dw.veg/(all$dw.repro + all$dw.veg))*100

#percent reproductive apices
all$perc.ra<-(all$apices.repro/(all$apices.repro + all$apices.veg))*100

#average oogonia per conceptacle
all$oog.per.con<-rowMeans(all[,c('oog.conc.1', 'oog.conc.2', 'oog.conc.3')], na.rm=TRUE)

#conceptacle per receptacle
all$con.per.rec<-all$oog.per.con*all$no.concept.recp

#oogonia per reproductive apice
all$oo.per.ra<-all$con.per.rec/2

#oogonia per thalli
all$oo.per.thalli<-(all$oo.per.ra*all$apices.repro)

Write csv

write.csv(all, "C:/Users/chels/Box Sync/Thesis/Data/Working data/Final data/CB_field_data_plus.csv")

Data frame on GitHub: https://raw.githubusercontent.com/Cmwegener/thesis/master/data/field/CB_field_data_plus.csv