lizzieinvancouver / egret

2 stars 0 forks source link

check cleanScarification.R #62

Open lizzieinvancouver opened 3 months ago

lizzieinvancouver commented 3 months ago

@buniwuuu Here is some cleaning code I find around the cleaning/ folder from cleaning LONG ago (so may be irrelevant now). Can you review it and confirm you caught all these issues in your cleaning code? Thank you!


# From clean_other.R, Original file called coordinate_cleaning_JS.R

unique(egret$scarification)
unique(egret$scarif.type)

egret$scarif.type[which(egret$scarif.type == "sandpaper")] <- "mechanical - sandpaper"
egret$scarif.type[which(egret$scarif.type == "sand paper (Np. 150)")] <- "mechanical - sandpaper"

egret$scarif.type[which(egret$scarif.type == "mechanical with razor")] <- "mechanical - razor"
egret$scarif.type[which(egret$scarif.type == "H2SO4")] <- "chemical - H2SO4"

chemical <- egret[which(egret$scarif.type == "chemical"),]
#jacquemart21 was in H2so4 but was inputted under the chemical column??  - JS
egret$scarif.type[which(egret$scarif.type == "chemical")] <- "chemical - H2SO4"

# From cleaningDL.R

unique(egret$scarification)
unique(egret$scarif.type)

egret$scarif.type[which(egret$scarif.type == "sandpaper")] <- "mechanical - sandpaper"
egret$scarif.type[which(egret$scarif.type == "sand paper (Np. 150)")] <- "mechanical - sandpaper"

egret$scarif.type[which(egret$scarif.type == "mechanical with razor")] <- "mechanical - razor"
egret$scarif.type[which(egret$scarif.type == "H2SO4")] <- "chemical - H2SO4"

#TO CHECK
# acid - what kinds?
#scapel - removing what
# soaking in water?
#cold
lizzieinvancouver commented 3 months ago

@DeirdreLoughnan Do we clean soaking anywhere? If not, I suggest we add it to cleanScarification.R (rename cleanScarificationSoaking.R ... see below code:


## Clean soaking perhaps? Or we could add to cleanScarification

# From clean_other.R, Original file called coordinate_cleaning_JS.R

unique(egret$soaking)
unique(egret$soaked.in)
egret$soaked.in[which(egret$soaked.in == "water")] <- "H20"
egret$soaked.in[which(egret$soaked.in == "Water")] <- "H20"

egret$soaked.in[which(egret$soaked.in == "hot H2O - 100C")] <- "H2O 100C"
egret$soaked.in[which(egret$soaked.in == "100C water")] <- "H2O 100C"

egret$soaked.in[which(egret$soaked.in == "water 35ºC")] <- "H20 35C"
egret$soaked.in[which(egret$soaked.in == "35C water")] <- "H20 35C"

egret$soaked.in[which(egret$soaked.in == "60C water")] <- "H20 60C"
egret$soaked.in[which(egret$soaked.in == "80C water")] <- "H20 80C"
egret$soaked.in[which(egret$soaked.in == "5 C water")] <- "H20 5C"

egret$soaked.in[which(egret$soaked.in == "water 35ºC")] <- "H20 35C"

#TO CHECK
# what is N, 0 KNO3 - sounds like a control,
N <- egret[which(egret$soaked.in == "N"),] #Bhatt00 is not on the google drive. Check later - JS
KNO3 <- egret[which(egret$soaked.in == "0 KNO3"),]
#cho18 (seed germination) 0 KNO3 means there was no KNO3 (control) - JS

# battaglia93   and 97, what is MPa water and a water solution? - could not find battaglia 93 and 97 - JS

##
## I deleted identical entries to above in cleaning_DL.R (Lizzie on 16 July 2024)
buniwuuu commented 3 months ago

@lizzieinvancouver we do have a "moisture" scarification type in the cleanScarification.R file, I can work on merging those water scarification with soaking if that sounds good? or would you prefer two separate columns?

DeirdreLoughnan commented 3 months ago

@buniwuuu @lizzieinvancouver I think these should be kept as separate columns, since not all soaking is for scarification purposes.

But @buniwuuu could you:

lizzieinvancouver commented 2 months ago

@buniwuuu Friendly reminder to check in on this issue and help us finish it once you are back and have had some post-field recovery time. Thank you!

buniwuuu commented 2 months ago

@lizzieinvancouver hi Lizzie! I added a column "treatmentFixed" for cleaned treatment names and cleaned the soaking treatment names. Please let me know if there's anything else!

lizzieinvancouver commented 1 month ago

@lizzieinvancouver hi Lizzie! I added a column "treatmentFixed" for cleaned treatment names and cleaned the soaking treatment names. Please let me know if there's anything else!

@buniwuuu That's weird, because you have NO commits to the repo since May (see https://github.com/lizzieinvancouver/egret/commits/main/?author=buniwuuu). Can you check if you actually pushed your code?

buniwuuu commented 2 weeks ago

@lizzieinvancouver it should be updated now! I might have replaced the file when I organized my local directories in September...

lizzieinvancouver commented 4 days ago

@buniwuuu Thanks! @christophe-rd when you get back to issue #70 I think perhaps some of the code in cleanScarification.R needs to be handled in your code -- or at least they all need to work together well. Specifically, @buniwuuu started a new column for cleaned treatment ... we may need to update to your name if you have this (be sure to follow rules and how we did it before ... I think it should be treatmentCor? Not sure and on weak internet so cannot check the wiki).

Here's the code:

#fixing treatment names 
d$treatmentFixed <- d$treatment
#controls 
d$treatmentFixed[which(d$scarifType == "H2SO4.98per.0min" | d$scarifType == "hot.water.0min")] <- "control"

# Al-Absi10
# they see GA3 as scarifcation too but in our cleaning we put GA3 in a separate column, hence NA for GA3 scarifications
d$other.treatment[which((d$datasetID == "Al-Absi10" | 
                           d$datasetID == "al-absi10") & 
                          d$scarifTypeGen == "soaking")] <- d$scarifType[which((d$datasetID == "Al-Absi10" | 
                                                                                   d$datasetID == "al-absi10") & 
                                                                                  d$scarifTypeGen == "soaking")]
d$treatmentFixed[which(d$datasetID == "al-absi10" & d$scarifTypeGen == "soaking")] <- "hot water scarification"

# prknova15
# both seed coat removal and soaking
d$other.treatment[which((d$datasetID == "prknova15") & 
                          d$scarifTypeGen == "soaking")] <- d$scarifType[which((d$datasetID == "prknova15") & 
                                                                                  d$scarifTypeGen == "soaking")]
d$treatmentFixed[which((d$datasetID == "prknova15") & d$scarifTypeGen == "soaking")] <- "seed coat removal, soaking in water"

# rouhi13
d$other.treatment[which((d$datasetID == "rouhi13") & 
                          d$scarifTypeGen == "soaking")] <- d$scarifType[which((d$datasetID == "rouhi13") & 
                                                                                  d$scarifTypeGen == "soaking")]
# Wickens01
d$treatmentFixed[which((d$datasetID == "Wickens01") & 
                    d$scarif.type == "hot water 70C")] <- "hot water 70C"
d$treatmentFixed[which((d$datasetID == "Wickens01") & 
                    d$other.treatment == "soaking")] <- "soaking"

print(d$treatmentFixed[which(d$scarifTypeGen == "soaking")])