githubURL <- ("https://raw.githubusercontent.com/Curso-programacion/Tarea_1/master/Protected_Areas.rds")
download.file(githubURL, "PA.rds", method = "curl")
PA <- readRDS("PA.rds")
## [1] TRUE
22/11, 2020
githubURL <- ("https://raw.githubusercontent.com/Curso-programacion/Tarea_1/master/Protected_Areas.rds")
download.file(githubURL, "PA.rds", method = "curl")
PA <- readRDS("PA.rds")
## [1] TRUE
library(tidyverse)
ggplot(PA, aes(x = STATUS_YR, y = TERR_AREA)) + geom_point(aes(color = DESIG)) +
theme_classic()
ggplot(PA, aes(x = STATUS_YR, y = TERR_AREA)) + geom_point(aes(color = DESIG)) +
theme_classic()
ggplot(PA, aes(x = STATUS_YR, y = TERR_AREA)) + geom_point(aes(color = DESIG),
alpha = 0.5) + theme_classic()
ggplot(PA, aes(x = STATUS_YR, y = TERR_AREA)) + geom_point(aes(color = DESIG)) +
theme_classic() + scale_y_continuous(labels = scales::comma)
ggplot(PA, aes(x = STATUS_YR, y = TERR_AREA)) + geom_point(aes(color = DESIG)) +
theme_classic() + scale_y_log10(labels = scales::comma)
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point(aes(size = hp)) +
theme_classic()
ggplot(PA, aes(x = STATUS_YR, y = TERR_AREA)) + geom_point(aes(color = IUCN_CAT,
shape = IUCN_CAT)) + theme_classic() + scale_y_log10(labels = scales::comma)
ggplot(PA, aes(x = IUCN_CAT, y = TERR_AREA)) + geom_boxplot(aes(fill = IUCN_CAT),
notch = T) + theme_bw() + scale_y_log10(label = scales::comma)
ggplot(iris, aes(x = Species, y = Sepal.Width)) + geom_jitter(aes(color = Species))
ggplot(iris, aes(x = Species, y = Sepal.Width)) + geom_violin(fill = "red")
ggplot(iris, aes(x = Species, y = Sepal.Width)) + geom_violin() +
geom_jitter(aes(color = Species))
ggplot(iris, aes(x = Species, y = Sepal.Width)) + geom_jitter(aes(color = Species)) +
geom_violin()
ggplot(iris, aes(x = fct_reorder(Species, Sepal.Width),
y = Sepal.Width)) + geom_boxplot(aes(fill = Species),
notch = T) + theme_bw()
ggplot(iris, aes(x = fct_reorder(Species, Sepal.Width),
y = Sepal.Width)) + geom_boxplot(aes(fill = Species),
notch = T) + theme_bw() + xlab("lo que se me ocurra")
ggplot(iris, aes(x = fct_relevel(Species, "setosa",
"virginica"), y = Sepal.Width)) + geom_boxplot(aes(fill = Species),
notch = T) + theme_bw() + xlab("lo que se me ocurra")




data("mtcars")
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_smooth() +
geom_point()
data("mtcars")
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_smooth(method = "lm") +
geom_point()
ggplot(PA, aes(x = STATUS_YR, y = TERR_AREA)) + geom_point(aes(color = DESIG)) +
theme_bw() + scale_y_log10(labels = scales::comma) +
labs(x = "AƱo", y = "Ćrea en hectĆ”reas", title = "Ćreas protegidas de Chile") +
facet_wrap(~IUCN_CAT)