0

I want to extract one WDPA polygon at a time after downloading protected area data for the entire Democratic Republic of the Congo (IS0 3 = COD) using the wdpar package. Preferably, I would like to extract the polygon by specifying a value in the WDPAID (ex. 124389 is the ID for Okapis Wildlife Reserve). How do I do this? I tried "plot((cod_pa_data[cod_pa_data$WDPAID == 124389]))" but it did not work properly.

library(wdpar)
library(dplyr)
library(ggmap)
cod_raw_pa_data <- wdpa_fetch("COD")
cod_pa_data <- wdpa_clean(cod_raw_pa_data)

cod_pa_data

Simple feature collection with 47 features and 28 fields
geometry type:  MULTIPOLYGON
dimension:      XY
bbox:           xmin: 1179127 ymin: -1419811 xmax: 2914336 ymax: 686464
CRS:            +proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +datum=WGS84 +ellps=WGS84 +units=m +no_defs
precision:      1500 
# A tibble: 47 x 29
   WDPAID WDPA_PID PA_DEF NAME  ORIG_NAME DESIG DESIG_ENG DESIG_TYPE IUCN_CAT INT_CRIT MARINE
    <dbl> <chr>    <chr>  <chr> <chr>     <chr> <chr>     <chr>      <chr>    <chr>    <chr> 
 1 5.56e8 5555120… 1      Yang… Yangambi  Rése… Biospher… National   Ia       Not App… terre…
 2 5.56e8 5555120… 1      Bomu  Bomu      Rése… Wildlife… National   Ib       Not App… terre…
 3 1.67e5 166889   1      Viru… Virunga   Parc… National… National   II       Not App… terre…
 4 1.08e3 1083     1      Gara… Garamba   Parc… National… National   II       Not App… terre…
 5 1.08e3 1079     1      Upem… Upemba    Parc… National… National   II       Not App… terre…
 6 1.08e3 1080     1      Maiko Maiko     Parc… National… National   II       Not App… terre…
 7 1.08e3 1082     1      Kahu… Kahuzi-B… Parc… National… National   II       Not App… terre…
 8 1.08e3 1084     1      Kund… Kundelun… Parc… National… National   II       Not App… terre…
 9 5.56e8 5556978… 1      Salo… Parc Nat… Parc… National… National   II       Not App… terre…
10 3.70e4 37043    1      Okap… Okapis    Rése… Wildlife… National   II       Not App… terre…
# … with 37 more rows, and 18 more variables: REP_M_AREA <dbl>, REP_AREA <dbl>, NO_TAKE <chr>,
#   NO_TK_AREA <dbl>, STATUS <chr>, STATUS_YR <dbl>, GOV_TYPE <chr>, OWN_TYPE <chr>, MANG_AUTH <chr>,
#   MANG_PLAN <chr>, VERIF <chr>, METADATAID <int>, SUB_LOC <chr>, PARENT_ISO <chr>, ISO3 <chr>,
#   GEOMETRY_TYPE <chr>, AREA_KM2 <dbl>, geometry <MULTIPOLYGON [m]>
2
  • You are missing the comma for the row index try: plot( cod_pa_data[cod_pa_data$WDPAID == 124389,] ) Jul 16 '20 at 19:24
  • Thank you so much! @JeffreyEvans Jul 17 '20 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.