cwiczenia 1
This commit is contained in:
parent
ec13dd5732
commit
a4b0afcc6d
59
cw1.R
Normal file
59
cw1.R
Normal file
@ -0,0 +1,59 @@
|
||||
library("sf")
|
||||
library("raster")
|
||||
library("spData")
|
||||
library("spDataLarge")
|
||||
library(dplyr)
|
||||
library(ggplot2)
|
||||
|
||||
names(world)
|
||||
class(world)
|
||||
plot(world)
|
||||
|
||||
summary(world)
|
||||
summary(world["lifeExp"])
|
||||
|
||||
world_mini <- world[1:2,1:3]
|
||||
world_mini
|
||||
|
||||
|
||||
# Wyœwietlcie mapê krajów Europejskich wg liczby ludnoœci
|
||||
world %>%
|
||||
filter(continent == "Europe") %>%
|
||||
select(pop) %>%
|
||||
plot()
|
||||
|
||||
|
||||
world %>%
|
||||
filter(continent == "Europe") %>%
|
||||
select(pop) -> europe_pop
|
||||
|
||||
plot(europe_pop)
|
||||
|
||||
|
||||
# Który kraj posiada najmniejsz¹ liczbê ludnoœci i ile wynosi?
|
||||
world %>%
|
||||
arrange(pop) %>%
|
||||
select(name_long,pop) %>%
|
||||
top_n(-10,wt=pop)
|
||||
|
||||
|
||||
# Ile krajów znajduje siê w Azji?
|
||||
world %>%
|
||||
filter(continent == "Asia") %>%
|
||||
count()
|
||||
|
||||
# Wyœwietlcie histogram powierzchni wszystkich niezale¿nych krajów (Sovereign Country)
|
||||
world %>%
|
||||
filter(type == "Sovereign country") %>%
|
||||
ggplot(aes(area_km2)) +
|
||||
geom_histogram(bins = 150)
|
||||
|
||||
# Wyœwietlcie wykres punktowy relacji pomiêdzy lifeExp, a gdpPercap
|
||||
|
||||
world %>%
|
||||
ggplot(aes(x = lifeExp, y = gdpPercap)) +
|
||||
geom_smooth()
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user