Closed teixeirak closed 1 year ago
This also relates to issue #7, and I'll post something there.
For Manlay_2002_cnap (2nd batch), land categories did not get classified:
These two examples are technically wrong-- higher priority to solve this issue.
For Manlay_2002_cnap (2nd batch), land categories did not get classified:
Same goes for n_11_Manlay_2002_cnap (pending review)
I am noting here that my code is looking at this table so this is one entry point for fixing issue. I have not looked at the file yet. Still trying to grasp what you wrote in the different issues
recapping the steps in the code here:
### Define current_LU
ForC_simplified$current_LU <- ""
ForC_simplified$current_LU [ForC_simplified$dominant.life.form %in% "woody"] <- "Forest"
ForC_simplified$current_LU [ForC_simplified$dominant.life.form %in% "woody+grass"] <- "Forest, Grassland"
ForC_simplified$current_LU [ForC_simplified$dominant.life.form %in% "grass" & !my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age > 0] <- "Forest" # ("Land Converted to Forest Land (LF)")'
ForC_simplified$current_LU [ForC_simplified$dominant.life.form %in% "grass" & !my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age == 0] <- "Grassland"
ForC_simplified$current_LU [ForC_simplified$dominant.life.form %in% "crop" & !my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age == 0] <- "Cropland"
unique(ForC_simplified$dominant.life.form)
unique(ForC_simplified$current_LU) # should be no ""
unique(ForC_simplified[ForC_simplified$current_LU %in% "", c("dominant.life.form", "stand.age", "current_LU")]) # should be empty
already an issue here as I do have cases that did not map... I think because they are woody + grass
instead of woody+grass
--> inconsistancy in ForC --> fix in ForC
I am noting here that my code is looking at this table so this is one entry point for fixing issue. I have not looked at the file yet. Still trying to grasp what you wrote in the different issues
I don't think there's a problem in this table...
For past LU, I also have cases that don't map...
Two last columns are min stand age and max stand age, for all sites for which it didn't map.
I'll have to return to this tomorrow
For info, here is the code.
### Define past_LU
ForC_simplified$past_LU <- ""
#### stand.age ≥ 20 or missing value for stand.ag --> past_LU = current_LU
ForC_simplified$past_LU[my_is.na(ForC_simplified$stand.age) | ForC_simplified$stand.age >=20] <- ForC_simplified$current_LU[my_is.na(ForC_simplified$stand.age) | ForC_simplified$stand.age >=20]
#### stand.age < 20 --> PAST LAND-USE is dependent on distmrs.type
unique(ForC_simplified$distmrs.type)
ForC_simplified$past_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20) & ForC_simplified$distmrs.type %in% "Grazed"] <- "Grassland"
ForC_simplified$past_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20) & ForC_simplified$distmrs.type %in% c("Cultivation", "Shifting cultivation", "Tillage")] <- "Cropland"
ForC_simplified$past_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20) & ForC_simplified$distmrs.type %in% c("Agriculture_generic")] <- "Cropland or Grassland"
ForC_simplified$past_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20) & ForC_simplified$distmrs.type %in% c("No disturbance", "No severe disturbance", "Flood", "Forest dieback", "Landslide","Major Storm")] <- ForC_simplified$current_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20) & ForC_simplified$distmrs.type %in% c("No disturbance", "No severe disturbance", "Flood", "Forest dieback", "Landslide","Major Storm")]
ForC_simplified$past_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20) & ForC_simplified$distmrs.type %in% c("Cut", "Harvest")] <- ForC_simplified$current_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20) & ForC_simplified$distmrs.type %in% c("Cut", "Harvest")]
ForC_simplified$past_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20) & ForC_simplified$distmrs.type %in% c("Burned", "StandClearing") | my_is.na( ForC_simplified$distmrs.type)] <- ""
unique(ForC_simplified$past_LU)
sum(ForC_simplified$past_LU[(!my_is.na(ForC_simplified$stand.age) & ForC_simplified$stand.age <20)]%in%"")
unique(ForC_simplified[ForC_simplified$past_LU %in% "", c("distmrs.type", "stand.age", "past_LU")]) # should be empty
I think this should be fixed but I'll let you double check and close @teixeirak
Hmmm... For Manlay we now get this:
The one that did get classified is age 26; the rest are younger. So I think we're missing savanna < 20 yrs
This must have been fixed, right @teixeirak?
I don't see the record, but Manley has been sent, and there was no NA in columns X2006.Source.Sink.Categories..CODE1.....
and X2006.Source.Sink.Categories..CODE1.....
Unless the data with NA was dropped....
I also see that we "canceled" a Manlay that had 17 data points with NA. WE eventually sent 28 data points with no NA
Yes, I think this is fixed.
@ValentineHerr , I'm not sure if we're consistently getting the past land use & land classification right. This is based on these instructions.
Here's an example (Feldpausch_2004_cana) where the disturbance history for all was the following sequence:
All have
distmrs.type
= grazed in plots.So, they should all be classified as pasture converted to forest (5-FL-2 and 3.B.1.b.ii), yet 3 get classified as forest remaining forest (F-FL-2 and 3.B.1.a):
This