Commit 4b0264dd authored by peguerin's avatar peguerin
Browse files

add GD_mean raw

parent 5f40a8f8
...@@ -73,22 +73,26 @@ convertedCoords_M=convert_coordinates_into_epsg4326(dcM, dcM.1, grid) ...@@ -73,22 +73,26 @@ convertedCoords_M=convert_coordinates_into_epsg4326(dcM, dcM.1, grid)
convertedCoords_F=convert_coordinates_into_epsg4326(dcF, dcF.1, grid) convertedCoords_F=convert_coordinates_into_epsg4326(dcF, dcF.1, grid)
dcM.2=cbind(dcM.1,convertedCoords_M) dcM.2=cbind(dcM.1,convertedCoords_M)
dcF.2=cbind(dcF.1,convertedCoords_F) dcF.2=cbind(dcF.1,convertedCoords_F)
## add non transformed GD values
GD_mean_raw_M=dcM[which(dcM$cell %in% dcM.1$cell),]$GD_mean
GD_mean_raw_F=dcF[which(dcF$cell %in% dcF.1$cell),]$GD_mean
dcM.3=cbind(dcM.2,GD_mean_raw_M)
dcF.3=cbind(dcF.2,GD_mean_raw_F)
## load richness data ## load richness data
richness=read.csv("01-infos/equalarea_id_coordsCA_FWRS_MR_RS.csv") richness=read.csv("01-infos/equalarea_id_coordsCA_FWRS_MR_RS.csv")
Fr=merge(dcF.2,richness,by ="cell", all.x=F) Fr=merge(dcF.3,richness,by ="cell", all.x=F)
Fr=Fr[which(Fr$RS_FW_FISH !=0),] Fr=Fr[which(Fr$RS_FW_FISH !=0),]
Fr_wCoords=Fr[,c(2,3,4,6,7,24,29)] #with coordinates Fr_wCoords=Fr[,c(2,3,4,6,7,24,25,30)] #with coordinates
Fr=Fr[,c(1,4,6,7,24,29)] Fr=Fr[,c(1,4,6,7,24,25,30)]
Fr=na.omit(Fr) Fr=na.omit(Fr)
names(Fr)=c("cell","GD_mean","nb_species","nb_indv_mean","latitude","richness") names(Fr)=c("cell","scaled_GD_mean","nb_species","nb_indv_mean","latitude","GD_mean","richness")
Mr=merge(dcM.2,richness,by ="cell", all.x=F) Mr=merge(dcM.3,richness,by ="cell", all.x=F)
Mr=Mr[which(Mr$RS_MR_FISH !=0),] Mr=Mr[which(Mr$RS_MR_FISH !=0),]
Mr_wCoords=Mr[,c(2,3,4,6,7,24,30)] #with coordinates Mr_wCoords=Mr[,c(2,3,4,6,7,24,25,31)] #with coordinates
Mr=Mr[,c(1,4,6,7,24,30)] Mr=Mr[,c(1,4,6,7,24,25,31)]
Mr=na.omit(Mr) Mr=na.omit(Mr)
names(Mr)=c("cell","GD_mean","nb_species","nb_indv_mean","latitude","richness") names(Mr)=c("cell","scaled_GD_mean","nb_species","nb_indv_mean","latitude","GD_mean","richness")
Tr=rbind(Mr,Fr) Tr=rbind(Mr,Fr)
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment