[R์ R๋ ค์ค] R ๋ฐ์ดํฐ ์๊ฐํ
R ๊ธฐ๋ฐ ๋ฐ์ดํฐ ์๊ฐํ๐๋ฅผ ๊ฐ์ฅ ์ฝ๊ฒ ์ค๋ช ํ ๊ฐ์. (๊ฑฐ์) ๋ค ์๋ ค๋๋ฆผ๐. ๋ง์ง๋ง์๋ COVID-19 ๐๋ฐฑ์ ์ ์ข ๋ฐ์ดํฐ๋ฅผ ์ง๋๐บ๏ธ์ ๋ฟ๋ ค๋ด ๋๋ค!
์๊ฐ์ 352๋ช
๋์ด๋ ์ด๊ธ
์๊ฐ๊ธฐํ ๋ฌด์ ํ

- ํด๊ฒฐ
unique ํจ์ ์ฒ๋ฆฌ ๊ฒฐ๊ณผ
๋ค์๊ณผ ๊ฐ์ด csv ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์ค๊ณ unique(df$์ง์ญ) ํจ์๋ฅผ ์คํํ๋๋ฐ ๊ฐ์์์์ ๋ค๋ฅด๊ฒ "ํ์๋", "๊ฐ๋๊ตฌ", "์์ด๊ตฌ"๋ง ์ถ๋ ฅ๋๋๋ฐ ์ด์ ๊ฐ ์์๊น์?df = read.csv("Seoul_COVID19_20210511.csv
rggplot2magnet0922
ใป
0
495
1
- ๋ฏธํด๊ฒฐ
rgdal ๋ผ์ด๋ธ๋ฌ๋ฆฌ
> install.packages("rgdal") WARNING: Rtools is required to build R packages but is not currently installed. Please download and install
rggplot2magnet0922
ใป
1
2,238
1
- ํด๊ฒฐ
countries110 ๊ด๋ จ ์ง๋ฌธ
countries110@data ์ฝ๋๋ฅผ ์คํํ์ ๋ ๋ค์๊ณผ ๊ฐ์ด ์๋ฌ๋ฌธ๊ตฌ๊ฐ ๋จ๋ฉด์ ์คํ์ด ์๋๋๋ฐ ์ ๊ทธ๋ฐ ๊ฒ์ผ๊น์? countries110@data์์ ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ์ต๋๋ค: no applicable
rggplot2magnet0922
ใป
1
333
1
- ํด๊ฒฐ
scirpt_v2_2
getwd() setwd("C:/Users/yun/Desktop/") #### 1. ์ธ๊ตฌ ํต๊ณ ์ฒ๋ฆฌ #### df_pop = read.csv("Population.csv") head(df_pop) df_pop[, "value"] = gsub(pa
rggplot2phys
ใป
1
290
2
- ํด๊ฒฐ
scirpt_v2
์ด๋ ๊ฒ ๋ง์ํ์๋ฉด ์ดํดํ๊ธฐ๊ฐ ์ด๋ ต์ต๋๋ค.์๋ก ์ฌ๋ ค์ฃผ์ script_v
rggplot2phys
ใป
0
265
1
- ํด๊ฒฐ
๋ฐฑ์ ์ ์ข ๋ฐ์ดํฐ๊ฐ์/df_map_join_vac ๋ฌด์จ ๊ฐ์ ๊ฐ์ง๊ณ ์๋์ง ๋ฐ์ดํฐ์๊ฐํ ์ด๋ ค์
<img src="https://cdn.inflearn.c
rggplot2phys
ใป
0
232
1
- ๋ฏธํด๊ฒฐ
๋ฐฑ์ ๋ฐ์ดํฐ ๊ฐ์. df_agg = aggregate(data = df[, -5], total ~ ., FUN = "sum")์ดํด
์๋ก ์ฌ๋ ค์ฃผ์ ํ์ผ๋ก ๋ฐฑ์ ๋ฐ์ดํฐ ๊ณต๋ถ์ค์ ๋๋ค.df_agg = aggr
rggplot2phys
ใป
0
227
1
- ํด๊ฒฐ
๋ฐฑ์ ๋ฐ์ดํฐ์ ์ข ๊ฐ์/problem with id.id์กด์ฌx/df_map_join=left_join(df_map,df_countries, by=c("id"="id"))
<img s
rggplot2phys
ใป
1
275
1
- ํด๊ฒฐ
๋ฐ์ดํฐ ์ ๊ณต ์ข ๋ฃํ๋ค๊ณ ํฉ๋๋ค.. ๋ง์ง๋ง ๊ฐ์ ๋ฃ๊ณ ์ถ์๋ฐ, ๋ฐ์ดํฐ๋ฅผ ๋ฐ์ ์๊ฐ ์์ด์..์ด์ฐํด์ผ๋๋์
<a target="_blank" rel="noopener noreferrer n
rggplot2phys
ใป
1
289
2
- ํด๊ฒฐ
countries110, ne_countries() ์ธ๊ณ ์ง๋ ๋ฐ์ดํฐ ์ฒ๋ฆฌ
์ง๋์ ํ๋ณด ์ฐจํธ์์ ne_countries() ๊ฐ์ ธ์์๋ฐ์ดํฐ๋ฅผ ํ์ธํ๋ ๋ถ๋ถmap@data๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ๋ฒ์ ์ ์ด ๋๋ฉด์ @์ ๋ํ ์๋ฌ๊ฐ ๋น๋๋ค.no applicable method fo
e89cokr
ใป
1
468
3
- ๋ฏธํด๊ฒฐ
R ์๊ฐํ ๋๊ตฌ์ ์ ์์ ๋ถํ๋ ์์ํฌ ์ฐ๊ณ๋ฅผ ํตํ ์ธํฐ์ํฐ๋ธ์น
๊ต์๋! ์ข์๊ฐ์ ๊ฐ์ฌํฉ๋๋ค. R์์ ์ง์ํ๋ ์๊ฐํ ๋๊ตฌ๋ฅผ ์ ์์ ๋ถํ๋ ์์ํฌ ๊ธฐ๋ฐ ์น์ ์ฐ๊ณํ์ฌ ์ธํฐ์ํฐ๋ธ ์น ๊ตฌํ์ด ๊ฐ๋ฅํ์ง ์ฌ์ญ๊ณ ์ถ์ต๋๋ค. ์ค๋ผํด DB์์ ๋ฐ์ดํฐ๊ฐ ๋ณ๊ฒฝ๋์์๋ ์ค์๊ฐ์ผ๋ก ์ฐจํธ๋ ๊ทธ๋ํ์ ๋ฐ์์ด ๊ฐ๋ฅํ
rR์๊ฐํggplot์น์ ์์ ๋ถ๋นํฉํ ๋น๋๊ท
ใป
4
295
1






