f_data <- "Chapter07-latlong-cities-brazil.csv" av_data <- vdr::data_list(be_silent = TRUE) if (!f_data %in% av_data) { cli::cli_abort("cant find {f_data}") } #check_answers(my_answers)
Utilizando função geobr::read_state()
, baixe os dados do estado do Rio Grande do Sul e, com os dados disponíveis no arquivo "r f_data
" do pacote vdr
:
df_rs <- geobr::read_state(code_state = "RS") f_cities <- "Chapter07-latlong-cities-brazil.csv" df_cities_rs <- vdr::data_import(f_cities) |> dplyr::filter(codigo_uf == 43) # 43 is state of RS poa <- df_cities_rs |> dplyr::filter(capital == TRUE) p <- ggplot() + geom_sf(data = df_rs) + # etapa 01 geom_point(data = df_cities_rs, aes(y = latitude, x = longitude), color = 'blue', size = 1, alpha = 0.5) + # etapa 02 geom_point(data = poa, aes(y = latitude, x = longitude), color = 'red', size = 2, alpha = 1) + # etapa 03 geom_text(data = poa, aes(y = latitude, x = longitude, label = "PORTO ALEGRE"), color = 'black', size = 3, alpha = 1, nudge_y = 0.25) + # etapa 04 labs(title = "Cidades do Estado do Rio Grande do Sul", caption = "Dados do IBGE e pacote vdr") p
extype: string
exsolution: r mchoice2string(c(TRUE, FALSE, FALSE, FALSE, FALSE), single = TRUE)
exname: "stats 01"
exshuffle: TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.