From c4401c9e594054146f44d1f630eb7300b20c05cd Mon Sep 17 00:00:00 2001 From: Brian Langseth Date: Fri, 3 Jan 2025 10:10:20 -0800 Subject: [PATCH] Convert TL to FL for historical Miller datasets Closes #30 --- code/recfin_processing.R | 7 +- data/CAquillback_historical_bio.csv | 180 ++++++++++++++-------------- 2 files changed, 95 insertions(+), 92 deletions(-) diff --git a/code/recfin_processing.R b/code/recfin_processing.R index 5730d15..e764e08 100644 --- a/code/recfin_processing.R +++ b/code/recfin_processing.R @@ -1118,7 +1118,8 @@ milgot_bio <- milgot_bio %>% tidyr::uncount(Count) ## Simplify variables -milgot_bio$length_cm <- milgot_bio$Length..cm. +#Lengths are in TL. Convert to FL using conversion (in mm) from echeverria and lenarz 1984 +milgot_bio$length_cm <- (9.075 + 0.965 * milgot_bio$Length..cm. * 10)/10 milgot_bio$weight_kg <- NA #Replace port with district milgot_bio$area <- dplyr::case_when(milgot_bio$Port == "Bodega Bay" ~ "Bay", @@ -1178,7 +1179,8 @@ milgei_bio <- milgei_bio %>% tidyr::uncount(NUMBER_OF_FISH) ## Simplify variables -milgei_bio$length_cm <- milgei_bio$LENGTH/10 +#Lengths are in TL. Convert to FL using conversion from echeverria and lenarz 1984 +milgei_bio$length_cm <- (9.075 + 0.965 * milgei_bio$LENGTH)/10 milgei_bio$weight_kg <- NA #Replace port with district milgei_bio$area <- dplyr::case_when(milgei_bio$Counties == "DelNorte_Humboldt" ~ "Redwood", @@ -1303,6 +1305,7 @@ table(geicol_bio$LENGTH) ## Simplify variables +#According to report, measurements were as fork length geicol_bio$length_cm <- geicol_bio$LENGTH/10 geicol_bio$weight_kg <- NA diff --git a/data/CAquillback_historical_bio.csv b/data/CAquillback_historical_bio.csv index e6467ab..bd6a3f0 100644 --- a/data/CAquillback_historical_bio.csv +++ b/data/CAquillback_historical_bio.csv @@ -1,91 +1,91 @@ "Year","length_cm","weight_kg","sex","area","mode","disp","source","tripID" -1960,37,NA,"U","Bay","PC","RETAINED","MilGot","1960AprilBodega BayPC" -1960,44,NA,"U","Bay","PC","RETAINED","MilGot","1960AprilBodega BayPC" -1960,39,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" -1960,43,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" -1960,44,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" -1960,45,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" -1960,49,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" -1960,29,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" -1960,30,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" -1960,36,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" -1960,38,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" -1960,38,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" -1960,42,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" -1960,46,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" -1960,46,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" -1960,35,NA,"U","Bay","PC","RETAINED","MilGot","1960JulyPrincetonPC" -1960,34,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustPrincetonPC" -1960,39,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberPrincetonPC" -1960,41,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberPrincetonPC" -1960,34,NA,"U","Bay","PC","RETAINED","MilGot","1960OctoberPrincetonPC" -1960,28,NA,"U","Bay","PR","RETAINED","MilGot","1960SeptemberBodega BayPR" -1960,30,NA,"U","Bay","PR","RETAINED","MilGot","1960SeptemberBodega BayPR" -1959,52,NA,"U","Wine","PR","RETAINED","MilGot","1959JuneFt. BraggPR" -1959,46,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberFt. BraggPR" -1959,48,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberFt. BraggPR" -1959,41,NA,"U","Wine","PR","RETAINED","MilGot","1959JulyShelter CovePR" -1959,42,NA,"U","Wine","PR","RETAINED","MilGot","1959AugustShelter CovePR" -1959,40,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" -1959,41,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" -1959,43,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" -1959,45,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" -1959,47,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" -1959,48,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" -1959,42.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,43.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,44.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,45.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,45.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,45.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,46.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,47.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,48.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,48.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,49.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,49.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,40.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,41.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,41.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,41.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,42.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,43.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,45.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,47.3,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,48.8,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" -1959,27.8,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,34.3,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,34.8,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,36.3,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,37.3,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,39.3,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,41.8,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,42.8,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,43.3,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,43.3,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,43.8,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,45.8,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1959,47.8,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" -1960,34.3,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" -1960,34.8,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" -1960,35.8,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" -1960,39.3,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" -1960,40.8,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" -1960,29.3,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,30.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,36.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,37.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,38.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,38.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,39.3,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,41.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,42.3,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,43.3,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,43.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,44.3,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,44.3,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,45.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,46.3,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,46.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,49.8,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" -1960,23,NA,"U","Central","PC","RETAINED","MilGei","1960SantaCruz_MontereyPC" +1960,36.6125,NA,"U","Bay","PC","RETAINED","MilGot","1960AprilBodega BayPC" +1960,43.3675,NA,"U","Bay","PC","RETAINED","MilGot","1960AprilBodega BayPC" +1960,38.5425,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" +1960,42.4025,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" +1960,43.3675,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" +1960,44.3325,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" +1960,48.1925,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustBodega BayPC" +1960,28.8925,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" +1960,29.8575,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" +1960,35.6475,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" +1960,37.5775,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" +1960,37.5775,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" +1960,41.4375,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" +1960,45.2975,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" +1960,45.2975,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberBodega BayPC" +1960,34.6825,NA,"U","Bay","PC","RETAINED","MilGot","1960JulyPrincetonPC" +1960,33.7175,NA,"U","Bay","PC","RETAINED","MilGot","1960AugustPrincetonPC" +1960,38.5425,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberPrincetonPC" +1960,40.4725,NA,"U","Bay","PC","RETAINED","MilGot","1960SeptemberPrincetonPC" +1960,33.7175,NA,"U","Bay","PC","RETAINED","MilGot","1960OctoberPrincetonPC" +1960,27.9275,NA,"U","Bay","PR","RETAINED","MilGot","1960SeptemberBodega BayPR" +1960,29.8575,NA,"U","Bay","PR","RETAINED","MilGot","1960SeptemberBodega BayPR" +1959,51.0875,NA,"U","Wine","PR","RETAINED","MilGot","1959JuneFt. BraggPR" +1959,45.2975,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberFt. BraggPR" +1959,47.2275,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberFt. BraggPR" +1959,40.4725,NA,"U","Wine","PR","RETAINED","MilGot","1959JulyShelter CovePR" +1959,41.4375,NA,"U","Wine","PR","RETAINED","MilGot","1959AugustShelter CovePR" +1959,39.5075,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" +1959,40.4725,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" +1959,42.4025,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" +1959,44.3325,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" +1959,46.2625,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" +1959,47.2275,NA,"U","Wine","PR","RETAINED","MilGot","1959SeptemberShelter CovePR" +1959,41.727,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,43.1745,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,43.657,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,44.622,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,44.622,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,44.622,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,46.0695,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,47.0345,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,47.517,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,47.9995,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,48.482,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,48.9645,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,39.797,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,40.762,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,41.2445,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,41.2445,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,42.2095,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,42.692,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,44.622,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,46.552,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,47.9995,NA,"U","Redwood","PR","RETAINED","MilGei","1959DelNorte_HumboldtPR" +1959,27.7345,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,34.007,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,34.4895,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,35.937,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,36.902,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,38.832,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,41.2445,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,42.2095,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,42.692,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,42.692,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,43.1745,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,45.1045,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1959,47.0345,NA,"U","Wine","PR","RETAINED","MilGei","1959Mendocino_SonomaPR" +1960,34.007,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" +1960,34.4895,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" +1960,35.4545,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" +1960,38.832,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" +1960,40.2795,NA,"U","Bay","PC","RETAINED","MilGei","1960SanFranciscoBayPC" +1960,29.182,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,30.6295,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,36.4195,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,37.3845,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,38.3495,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,38.3495,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,38.832,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,41.2445,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,41.727,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,42.692,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,43.1745,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,43.657,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,43.657,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,45.1045,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,45.587,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,46.0695,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,48.9645,NA,"U","Wine","PC","RETAINED","MilGei","1960Mendocino_SonomaPC" +1960,23.1025,NA,"U","Central","PC","RETAINED","MilGei","1960SantaCruz_MontereyPC"