해결된 질문
작성
·
183
·
수정됨
1
#문제를 해결하는데 도움이 될지모르겠습니다.
>
> library("rnaturalearth")
> map=ne_countries()
> df_map=fortify(map)
> names(df_map)
[1] "featurecla" "scalerank" "labelrank" "sovereignt" "sov_a3" "adm0_dif" "level" "type" "tlc"
[10] "admin" "adm0_a3" "geou_dif" "geounit" "gu_a3" "su_dif" "subunit" "su_a3" "brk_diff"
[19] "name" "name_long" "brk_a3" "brk_name" "brk_group" "abbrev" "postal" "formal_en" "formal_fr"
[28] "name_ciawf" "note_adm0" "note_brk" "name_sort" "name_alt" "mapcolor7" "mapcolor8" "mapcolor9" "mapcolor13"
[37] "pop_est" "pop_rank" "pop_year" "gdp_md" "gdp_year" "economy" "income_grp" "fips_10" "iso_a2"
[46] "iso_a2_eh" "iso_a3" "iso_a3_eh" "iso_n3" "iso_n3_eh" "un_a3" "wb_a2" "wb_a3" "woe_id"
[55] "woe_id_eh" "woe_note" "adm0_iso" "adm0_diff" "adm0_tlc" "adm0_a3_us" "adm0_a3_fr" "adm0_a3_ru" "adm0_a3_es"
[64] "adm0_a3_cn" "adm0_a3_tw" "adm0_a3_in" "adm0_a3_np" "adm0_a3_pk" "adm0_a3_de" "adm0_a3_gb" "adm0_a3_br" "adm0_a3_il"
[73] "adm0_a3_ps" "adm0_a3_sa" "adm0_a3_eg" "adm0_a3_ma" "adm0_a3_pt" "adm0_a3_ar" "adm0_a3_jp" "adm0_a3_ko" "adm0_a3_vn"
[82] "adm0_a3_tr" "adm0_a3_id" "adm0_a3_pl" "adm0_a3_gr" "adm0_a3_it" "adm0_a3_nl" "adm0_a3_se" "adm0_a3_bd" "adm0_a3_ua"
[91] "adm0_a3_un" "adm0_a3_wb" "continent" "region_un" "subregion" "region_wb" "name_len" "long_len" "abbrev_len"
[100] "tiny" "homepart" "min_zoom" "min_label" "max_label" "label_x" "label_y" "ne_id" "wikidataid"
[109] "name_ar" "name_bn" "name_de" "name_en" "name_es" "name_fa" "name_fr" "name_el" "name_he"
[118] "name_hi" "name_hu" "name_id" "name_it" "name_ja" "name_ko" "name_nl" "name_pl" "name_pt"
[127] "name_ru" "name_sv" "name_tr" "name_uk" "name_ur" "name_vi" "name_zh" "name_zht" "fclass_iso"
[136] "tlc_diff" "fclass_tlc" "fclass_us" "fclass_fr" "fclass_ru" "fclass_es" "fclass_cn" "fclass_tw" "fclass_in"
[145] "fclass_np" "fclass_pk" "fclass_de" "fclass_gb" "fclass_br" "fclass_il" "fclass_ps" "fclass_sa" "fclass_eg"
[154] "fclass_ma" "fclass_pt" "fclass_ar" "fclass_jp" "fclass_ko" "fclass_vn" "fclass_tr" "fclass_id" "fclass_pl"
[163] "fclass_gr" "fclass_it" "fclass_nl" "fclass_se" "fclass_bd" "fclass_ua" "geometry"
> head(df_map,2)
Simple feature collection with 2 features and 168 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: -180 ymin: -18.28799 xmax: 180 ymax: -0.95
Geodetic CRS: WGS 84
featurecla scalerank labelrank sovereignt sov_a3 adm0_dif level type tlc
1 Admin-0 country 1 6 Fiji FJI 0 2 Sovereign country 1
2 Admin-0 country 1 3 United Republic of Tanzania TZA 0 2 Sovereign country 1
admin adm0_a3 geou_dif geounit gu_a3 su_dif subunit su_a3 brk_diff name name_long brk_a3 brk_name
1 Fiji FJI 0 Fiji FJI 0 Fiji FJI 0 Fiji Fiji FJI Fiji
2 United Republic of Tanzania TZA 0 Tanzania TZA 0 Tanzania TZA 0 Tanzania Tanzania TZA Tanzania
brk_group abbrev postal formal_en formal_fr name_ciawf note_adm0 note_brk name_sort name_alt mapcolor7
1 <NA> Fiji FJ Republic of Fiji <NA> Fiji <NA> <NA> Fiji <NA> 5
2 <NA> Tanz. TZ United Republic of Tanzania <NA> Tanzania <NA> <NA> Tanzania <NA> 3
mapcolor8 mapcolor9 mapcolor13 pop_est pop_rank pop_year gdp_md gdp_year economy income_grp
1 1 2 2 889953 11 2019 5496 2019 6. Developing region 4. Lower middle income
2 6 2 2 58005463 16 2019 63177 2019 7. Least developed region 5. Low income
fips_10 iso_a2 iso_a2_eh iso_a3 iso_a3_eh iso_n3 iso_n3_eh un_a3 wb_a2 wb_a3 woe_id woe_id_eh woe_note
1 FJ FJ FJ FJI FJI 242 242 242 FJ FJI 23424813 23424813 Exact WOE match as country
2 TZ TZ TZ TZA TZA 834 834 834 TZ TZA 23424973 23424973 Exact WOE match as country
adm0_iso adm0_diff adm0_tlc adm0_a3_us adm0_a3_fr adm0_a3_ru adm0_a3_es adm0_a3_cn adm0_a3_tw adm0_a3_in adm0_a3_np adm0_a3_pk
1 FJI <NA> FJI FJI FJI FJI FJI FJI FJI FJI FJI FJI
2 TZA <NA> TZA TZA TZA TZA TZA TZA TZA TZA TZA TZA
adm0_a3_de adm0_a3_gb adm0_a3_br adm0_a3_il adm0_a3_ps adm0_a3_sa adm0_a3_eg adm0_a3_ma adm0_a3_pt adm0_a3_ar adm0_a3_jp
1 FJI FJI FJI FJI FJI FJI FJI FJI FJI FJI FJI
2 TZA TZA TZA TZA TZA TZA TZA TZA TZA TZA TZA
adm0_a3_ko adm0_a3_vn adm0_a3_tr adm0_a3_id adm0_a3_pl adm0_a3_gr adm0_a3_it adm0_a3_nl adm0_a3_se adm0_a3_bd adm0_a3_ua
1 FJI FJI FJI FJI FJI FJI FJI FJI FJI FJI FJI
2 TZA TZA TZA TZA TZA TZA TZA TZA TZA TZA TZA
adm0_a3_un adm0_a3_wb continent region_un subregion region_wb name_len long_len abbrev_len tiny homepart
1 -99 -99 Oceania Oceania Melanesia East Asia & Pacific 4 4 4 -99 1
2 -99 -99 Africa Africa Eastern Africa Sub-Saharan Africa 8 8 5 -99 1
min_zoom min_label max_label label_x label_y ne_id wikidataid name_ar name_bn name_de name_en name_es name_fa
1 0 3 8 177.97543 -17.826099 1159320625 Q712 فيجي ফিজি Fidschi Fiji Fiyi فیجی
2 0 3 8 34.95918 -6.051866 1159321337 Q924 تنزانيا তানজানিয়া Tansania Tanzania Tanzania تانزانیا
name_fr name_el name_he name_hi name_hu name_id name_it name_ja name_ko name_nl name_pl name_pt
1 Fidji Φίτζι פיג'י फ़िजी Fidzsi-szigetek Fiji Figi フィジー 피지 Fiji Fidżi Fiji
2 Tanzanie Τανζανία טנזניה तंज़ानिया Tanzánia Tanzania Tanzania タンザニア 탄자니아 Tanzania Tanzania Tanzânia
name_ru name_sv name_tr name_uk name_ur name_vi name_zh name_zht fclass_iso tlc_diff fclass_tlc
1 Фиджи Fiji Fiji Фіджі فجی Fiji 斐济 斐濟 Admin-0 country <NA> Admin-0 country
2 Танзания Tanzania Tanzanya Танзанія تنزانیہ Tanzania 坦桑尼亚 坦尚尼亞 Admin-0 country <NA> Admin-0 country
fclass_us fclass_fr fclass_ru fclass_es fclass_cn fclass_tw fclass_in fclass_np fclass_pk fclass_de fclass_gb fclass_br
1 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
2 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
fclass_il fclass_ps fclass_sa fclass_eg fclass_ma fclass_pt fclass_ar fclass_jp fclass_ko fclass_vn fclass_tr fclass_id
1 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
2 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
fclass_pl fclass_gr fclass_it fclass_nl fclass_se fclass_bd fclass_ua geometry
1 <NA> <NA> <NA> <NA> <NA> <NA> <NA> MULTIPOLYGON (((180 -16.067...
2 <NA> <NA> <NA> <NA> <NA> <NA> <NA> MULTIPOLYGON (((33.90371 -0...
#
df_countries에는 id가 있습니다.
df_map에는 id가 없습니다.
그래서 오류가 납니다. 도와주세요!!
나머지는 다 잘됩니다. 아래코드도 long객체를 찾을수없다며 안되기는 하는데 딱히 필요없을것같아서 생략했으나, 25:19초에 다시 이코드를 가져와서 쓰네요. 생략하면 안될것같네요. 이것도 뭐가 문제인지 모르겠습니다.
ggplot(data=df_map, aes(x=long, y=lat,group=group))+
geom_polygon()
답변 1
0
@phys 각 국가의 전체 인구 대비 숫자로 보시면 됩니다.
코드를 순차적으로 실행 할 때 1.193708 이 최대값으로 나오는데 보여주신 캡쳐는 3 근처의 값이 나온 것 같습니다. 코드를 다시 확인해보시면 좋을 것 같습니다.
자료해석에 어려움이 있습니다.
각 국가의 전체 인구 대비 백신접종숫자가 1.193708라는것은
인구대비 백신접종률이 119%라는 이야기인가요? 100%이상은 두번맞은 사람도 있어서그런가요
네 맞습니다.
아무래도 1차, 2차 이렇게 제공되지 않다고 총 백신 접종 숫자로 계산해서 그렇습니다.
자료 출처의 설명과 중간 데이터 핸들링 코드를 차근차근 다시 보시는 것을 추천드립니다.
답변 감사드립니다. 그런데 ratio %는 어떻게 읽는건가요??
0은 0%접종
1은 1%접종
2는 2%접종
3은 3%접종?
이렇게 읽는건지 어떻게 읽는건지 모르겠습니다