Skip to content

Commit 8e82684

Browse files
committed
Changes related to the new version of the the CNCFlora Red List
1 parent 25637e0 commit 8e82684

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

R/16_all_criteria.R

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,18 @@ all.crit <- cbind.data.frame(all.crit,
475475
stringsAsFactors = FALSE)
476476

477477
## Getting CNCFlora previous assessments with THREAT assessments
478-
tmp <- flora::get.taxa(all.crit$species, replace.synonyms = FALSE,
479-
drop = c())
480-
table(all.crit$species == tmp$original.search)
481-
all.crit$status.reflora <- tmp$threat.status
478+
tmp <- readxl::read_xlsx("data/data-raw/ProposituraAP_148_Lista de Espécies da Flora Avaliadas_2023.xlsx")
479+
tmp.spp <- tmp$`Nome científico atualizado até 2021 (Flora e Funga do Brasil)`
480+
tmp$genus <- gsub(" .*", "", tmp.spp, perl = TRUE)
481+
tmp$epiteth <- sapply(strsplit(tmp.spp, " ", fixed), function(x) x[2])
482+
tmp$species <- paste(tmp$genus, tmp$epiteth)
483+
# tmp <- flora::get.taxa(all.crit$species, replace.synonyms = FALSE,
484+
# drop = c())
485+
tmp <- tmp[!grepl(" var\\. | subsp\\. | f\\. ", tmp.spp, perl = TRUE),]
486+
tmp1 <- dplyr::left_join(all.crit, tmp, by = "species")
487+
table(all.crit$species == tmp1$species)
488+
all.crit$status.reflora <- as.character(tmp1$`Categoria Atual`)
489+
all.crit$categoria.reflora <- as.character(tmp1$Critério)
482490

483491
## Merging Argentina and Paraguay with THREAT assessments
484492
prev.assess.AR$species <- stringr::str_trim(prev.assess.AR$species)
@@ -647,6 +655,7 @@ all.crit$category.regional[grepl("widespread", all.crit$endemic) &
647655
all.crit$cat.reg.clean <- all.crit$category.regional
648656
all.crit$cat.reg.clean <- gsub("_PE|o$", "", all.crit$cat.reg.clean)
649657
all.crit$status.reflora <- gsub("DD\\|DD", "DD", all.crit$status.reflora)
658+
all.crit$status.reflora <- gsub("CRPE", "CR", all.crit$status.reflora)
650659

651660
#### SAVING THE FINAL RESULTS TABLE ####
652661
all.crit <- all.crit[order(all.crit$species),]

R/17_summary_results.R

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ table(all.crit$cat.reg.clean, all.crit$redlistCategory)
200200

201201
#How many species with CNCFlora assessments
202202
table(all.crit$status.reflora)
203-
100*sum(table(all.crit$status.reflora))/dim(all.crit)[1] # 19.7% with previous CNCFlora asses.; remained the same in both reviews
203+
100*sum(table(all.crit$status.reflora))/dim(all.crit)[1] # 19.7% with previous CNCFlora asses.; remained the same in 1st review; 48% in 2nd review
204204

205205
#How many species with national assessments
206206
tmp <- all.crit[!is.na(all.crit$status.reflora) |
207207
!is.na(all.crit$category.ARG) |
208208
!is.na(all.crit$category.PAY),]
209-
100 * dim(tmp)[1]/dim(all.crit)[1] # 20.3%; now 20.2%/ 2nd revision? the same
209+
100 * dim(tmp)[1]/dim(all.crit)[1] # 20.3%; now 20.2%/ 1st revision the same; 2nd revision 49%
210210

211211
## ENDEMIC SPECIES - proportions not show in the new version of the main text
212212
# #How may species with IUCN assessments
@@ -227,13 +227,14 @@ tmp <- all.crit[is.na(all.crit$redlistCategory) &
227227
is.na(all.crit$status.reflora) &
228228
is.na(all.crit$category.ARG) &
229229
is.na(all.crit$category.PAY),]
230-
dim(tmp)[1] # 2959 species (58.09%) without assessments; now 1923 assessments (38.8%); revised 1534 assessments (31%); 2nd revision 1532 assessments (31%)
231-
100 * dim(tmp)[1] / dim(all.crit)[1] # before 58.09%; now 38.8%; revised 31%; 2nd the same
232-
dim(tmp[tmp$endemic %in% "endemic",])[1] # before 1632 endemic species; now 1011; revised 768; 2n revision (the same)
233-
100 * dim(tmp[tmp$endemic %in% "endemic",])[1] / dim(tmp)[1] # before 55.12% without assessments; now: 52.6%; revised 50.1%; 2n revision (the same)
230+
dim(tmp)[1] # 2959 species (58.09%) without assessments; now 1923 assessments (38.8%); revised 1534 assessments (31%); 2nd revision 1120 assessments (31%)
231+
100 * dim(tmp)[1] / dim(all.crit)[1] # before 58.09%; now 38.8%; revised 31%; 2nd 23%
232+
dim(tmp[tmp$endemic %in% "endemic",])[1] # before 1632 endemic species; now 1011; revised 768; 2n revision 456
233+
100 * dim(tmp[tmp$endemic %in% "endemic",])[1] / dim(tmp)[1] # before 55.12% without assessments; now: 52.6%; revised 50.1%; 2n revision 40.71%
234234

235235
##Species EX or EW
236236
ex.spp <- all.crit$species[all.crit$redlistCategory %in% c("EX","EW")]
237+
ex.spp <- c(ex.spp, "Cathedra grandiflora", "Rustia simpsonii")
237238
all.crit[all.crit$species %in% ex.spp, cols]
238239
all.crit[all.crit$species %in% ex.spp, c("species","population")]
239240
oc.data <- readRDS("data/threat_occ_data_final.rds")
@@ -243,10 +244,16 @@ table(oc.data$coly, oc.data$tax)
243244
table(oc.data$coly >= 1998, oc.data$tax)
244245
table(oc.data$coly[is.na(oc.data$typeStatus)] >= 1998, oc.data$tax[is.na(oc.data$typeStatus)])
245246
oc.data[oc.data$tax %in% "Pouteria stenophylla",]
247+
oc.data[oc.data$tax %in% "Cathedra grandiflora",]
248+
oc.data[oc.data$tax %in% "Rustia simpsonii",]
249+
246250
#Identifications confirmed by specialists
247251
oc.data[oc.data$tax.check2 %in% "TRUE", c("coly","tax")]
248252
oc.data[oc.data$tax %in% c("Pouteria stenophylla"),
249253
c("coly","tax","tax.check2","source","detBy","dety","vouchers")]
254+
oc.data[oc.data$tax %in% c("Cathedra grandiflora", "Rustia simpsonii"),
255+
c("coly","tax","tax.check2","source","detBy","dety","vouchers")]
256+
250257

251258
# paths = dir("C://Users//renato//Documents//raflima//Pos Doc//Manuscritos//Artigo AF checklist//data analysis//occurrence_data",full.names=TRUE)
252259
# paths = paths[grepl('merged_outliers.csv',paths) & grepl('Sapotaceae',paths)]
@@ -267,7 +274,7 @@ red::rli(all.crit$cat.reg.clean[all.ids], boot = TRUE, runs = 50000) # now 0.48;
267274
#endemics: presenting only this one in the main text
268275
end.ids <- !is.na(all.crit$redlistCategory) & all.crit$endemic %in% "endemic"
269276
red::rli(all.crit$redlistCategory[end.ids], boot = TRUE, runs = 50000) #0.736; revised 0.742; 2nd revision: the same
270-
red::rli(all.crit$cat.reg.clean[end.ids], boot = TRUE, runs = 50000) #0.478; revised 0.484 [0.472-0.495]; 2nd revision: 0.484 [0.472-0.495]
277+
red::rli(all.crit$cat.reg.clean[end.ids], boot = TRUE, runs = 50000) #0.478; revised 0.484 [0.472-0.495]; 2nd revision: 0.498 [0.487-0.510]
271278

272279
## how many remained as LC in both assessemnts?
273280
tmp <- table(all.crit$cat.reg.clean[all.ids], all.crit$redlistCategory[all.ids])
@@ -403,7 +410,7 @@ table(tmp0$redlistCriteria, tmp0$EOO < 20000)
403410
table(tmp0$redlistCriteria, tmp0$AOO <= 2000, useNA = "always")
404411
table(tmp0$redlistCriteria, tmp0$reduction_A12 < 30, useNA = "always")
405412

406-
## MORE FORMAL COMAPRISON (ASKED BY THE REVIEWERS)
413+
## MORE FORMAL COMPARISON BETWEEN PREVIOUS (IUCN Red List) AND RE-ASSESSMENTS (HERE)
407414
# confusion matrix (all assessments)
408415
tmp <- all.crit[!is.na(all.crit$redlistCategory) &
409416
!all.crit$cat.reg.clean %in% c("NA", NA), ]

R/23_figures.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
### NOT ALL FIGURES ARE BEING GENERATED HERE
77
### MAPS ARE BEING GENERATED IN SCRIPT '22_maps.R'
88
### SOME OTHER FIGURES ARE BEING GENERATED WITHIN THE SCRIPTS...
9-
109
rm(list = ls())
1110
gc()
1211

@@ -159,7 +158,7 @@ mat <- as.matrix(table(paste0(all.crit$cat.reg.clean[all.crit$endemic %in% "ende
159158
mat <- mat[c(1,3,6,5,4,2), rev(c(4,1,3,8,7,5,2))]
160159

161160
#how many LC actually remained as LC?
162-
100*mat[5,2]/sum(mat[,2]) # 14.94%
161+
100*mat[5,2]/sum(mat[,2]) # 14.94%; 2n revision 17.6%
163162

164163
#Defining the colors of tracks and links
165164
grid.col = c(EX_prev = "black", CR_prev = "red", EN_prev = "darkorange", VU_prev = "gold", NT_prev = "yellowgreen", LC_prev = "forestgreen", DD_prev = "grey",
@@ -234,14 +233,13 @@ mat <- as.matrix(table(paste0(all.crit$cat.reg.clean[all.crit$endemic %in% "ende
234233
mat <- mat[c(1,3,6,5,4,2), rev(c(1,3,7,6,4,2))]
235234

236235
#how many LC actually remained as LC?
237-
100*mat[5,2]/sum(mat[,2]) # 14.94%
238-
236+
100*mat[5,2]/sum(mat[,2]) # 14.94%; 2n revision 17.5%
239237

240238
#Defining the colors of tracks and links
241239
grid.col = c(CR_prev = "red", EN_prev = "darkorange", VU_prev = "gold", NT_prev = "yellowgreen", LC_prev = "forestgreen", DD_prev = "grey",
242240
CR_new = "red", EN_new = "darkorange", VU_new = "gold", NT_new = "yellowgreen", LC_new = "forestgreen", DD_new = "grey")
243241
adjustcolor("forestgreen", alpha.f = 0.7)
244-
col_mat = rep(rev(c("red", "darkorange", "gold", "yellowgreen", "forestgreen", "grey")), each=5)
242+
col_mat = rep(rev(c("red", "darkorange", "gold", "yellowgreen", "forestgreen", "grey")), each=6)
245243
# mat[mat < 15] = mat[mat < 15]*1.25
246244
# mat[mat > 0 & mat < 5] = 5
247245
mat[mat < 10 & mat >= 5] = mat[mat < 10 & mat >= 5] + 1
@@ -253,15 +251,16 @@ transp[col_mat %in% "forestgreen"] <- 0.6
253251
circos.clear()
254252
circos.par(start.degree = 90)
255253
chordDiagram(mat, big.gap = 10, annotationTrack = "grid", annotationTrackHeight = mm_h(5),
256-
grid.col = grid.col, col = col_mat,
254+
grid.col = grid.col,
255+
col = col_mat,
257256
transparency = 0.3,
258257
#transparency = transp ,
259258
link.lwd = 4,
260259
h.ratio = 0.9,
261260
w2=0.5, rou=0.2
262261
)
263262
#Putting legends on
264-
sec.ind <- c("CR","EN","VU","NT","LC","DD","LC","NT","VU","EN","CR")
263+
sec.ind <- c("CR","EN","VU","NT","LC","","DD","LC","NT","VU","EN","CR")
265264
for(si in get.all.sector.index()) {
266265
lab <- sec.ind[which(si == get.all.sector.index())]
267266
xlim = get.cell.meta.data("xlim", sector.index = si, track.index = 1)
@@ -274,6 +273,7 @@ legend("topleft","Previous assess.", bty="n", cex=1.3, adj=c(.25,2.5))
274273
legend("topright","New assess.", bty="n", cex=1.3, adj=c(0.25,2.5))
275274
legend("topleft",legend=expression(bold("B - Regional")),
276275
bty="n",horiz=F,cex=1.5,x.intersp=-0.7,y.intersp=-0.2)
276+
text(0.1,-1.025,"DD", cex=1.1)
277277
dev.off()
278278

279279

data/all.criteria.rds

4.58 KB
Binary file not shown.

figures/Figure2.jpg

2.24 KB
Loading

0 commit comments

Comments
 (0)