Import your data
volcano <- read_csv(
"/Users/isabelk/Desktop/PSU_DAT3000_IntroToDA/06_module9/volcanos.csv",
skip = 1,
trim_ws = TRUE
)
## New names:
## Rows: 958 Columns: 35
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (17): volcano_name, primary_volcano_type, last_eruption_year, country, r... dbl
## (8): volcano_number...1, latitude, longitude, elevation, population_wit... lgl
## (10): volcano_number...22, volcano_number...27, ...28, ...29, ...30, ......
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `volcano_number` -> `volcano_number...1`
## • `` -> `...13`
## • `` -> `...19`
## • `volcano_number` -> `volcano_number...20`
## • `volcano_number` -> `volcano_number...21`
## • `volcano_number` -> `volcano_number...22`
## • `volcano_number` -> `volcano_number...27`
## • `` -> `...28`
## • `` -> `...29`
## • `` -> `...30`
## • `` -> `...31`
## • `` -> `...32`
## • `` -> `...33`
## • `` -> `...34`
## • `` -> `...35`
names(volcano) <- str_trim(names(volcano))
glimpse(volcano)
## Rows: 958
## Columns: 35
## $ volcano_number...1 <dbl> 283001, 355096, 342080, 213004, 321040, 28317…
## $ volcano_name <chr> "Abu", "Acamarachi", "Acatenango", "Acigol-Ne…
## $ primary_volcano_type <chr> "Shield(s)", "Stratovolcano", "Stratovolcano(…
## $ last_eruption_year <chr> "-6850", "Unknown", "1972", "-2080", "950", "…
## $ country <chr> "Japan", "Chile", "Guatemala", "Turkey", "Uni…
## $ region <chr> "Japan, Taiwan, Marianas", "South America", "…
## $ subregion <chr> "Honshu", "Northern Chile, Bolivia and Argent…
## $ latitude <dbl> 34.500, -23.292, 14.501, 38.537, 46.206, 37.6…
## $ longitude <dbl> 131.600, -67.618, -90.876, 34.621, -121.490, …
## $ elevation <dbl> 641, 6023, 3976, 1683, 3742, 1728, 1733, 1250…
## $ tectonic_settings <chr> "Subduction zone / Continental crust (>25 km)…
## $ evidence_category <chr> "Eruption Dated", "Evidence Credible", "Erupt…
## $ ...13 <chr> "Andesite / Basaltic Andesite", "Dacite", "An…
## $ major_rock_1 <chr> "Basalt / Picro-Basalt", "Andesite / Basaltic…
## $ major_rock_2 <chr> "Dacite", NA, NA, "Basalt / Picro-Basalt", NA…
## $ major_rock_3 <chr> NA, NA, NA, "Andesite / Basaltic Andesite", N…
## $ major_rock_4 <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ major_rock_5 <chr> NA, NA, "Basalt / Picro-Basalt", NA, "Dacite"…
## $ ...19 <chr> NA, NA, NA, NA, NA, "Basalt / Picro-Basalt", …
## $ volcano_number...20 <chr> NA, NA, NA, NA, NA, NA, NA, "Andesite / Basal…
## $ volcano_number...21 <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ volcano_number...22 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ population_within_5_km <dbl> 3597, 0, 4329, 127863, 0, 428, 101, 51, 0, 98…
## $ population_within_10_km <dbl> 9594, 7, 60730, 127863, 70, 3936, 485, 6042, …
## $ population_within_30_km <dbl> 117805, 294, 1042836, 218469, 4019, 717078, 1…
## $ Population_within_100_km <dbl> 4071152, 9092, 7634778, 2253483, 393303, 5024…
## $ volcano_number...27 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ...28 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ...29 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ...30 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ...31 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ...32 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ...33 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ...34 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ...35 <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…