Sérgio Costa
Sérgio Costa
  • 5
  • 67 262
Smooth lines with geom_smooth() + Facets with facet_wrap() | Professional dataviz with ggplot2 | R
5 minutes is enough to create a professional-looking and ready for publication chart. In this video i show how to add smoothing lines and the use of facet_wrap functions from ggplot2 package.
The code and files can be found on my github repository: github.com/sergiocostafh/ggplot2_dataviz
Forest sciences and biometrics in R (portuguese): mensura-r.netlify.app/
Video music: Kazukii - Dawn (th-cam.com/video/-UPBZ0AYigc/w-d-xo.html)
มุมมอง: 6 810

วีดีโอ

Population pyramid chart with geom_bar() | Professional dataviz with ggplot2 | R
มุมมอง 6K4 ปีที่แล้ว
*CORRECTION: I forgot to set the Y axis to absolute values ​​and because of that the labels on the left side of the axis are read negative. To fix it, just replace the command: scale_y_continuous (breaks = seq (-10,10,1), labels = function (x) {paste(abs (x), '%')}) The corrected version of the code can be found on my github (url below).] 5 minutes is enough to create a professional-looking and...
Raster maps with geom_raster() | Professional dataviz with ggplot2 | R
มุมมอง 21K4 ปีที่แล้ว
5 minutes is enough to create a professional-looking and ready for publication chart. In this video i show how to create raster maps using geom_raster() function from ggplot2 package. For this example, we use annual precipitation data for South America from WorldClim. The code and files can be found on my github repository: github.com/sergiocostafh/ggplot2_dataviz Forest sciences and biometrics...
Plotting longitudinal data with geom_point() + geom_line() | Professional dataviz with ggplot2 | R
มุมมอง 14K4 ปีที่แล้ว
5 minutes is enough to create a professional-looking and ready for publication chart. In this video i will show how to visualize longitudinal data using geom_point() and geom_line() functions from ggplot2 package. The data used in this video is the 'Orange' dataset from 'datasets' package. The code and files can be found on my github repository: github.com/sergiocostafh/ggplot2_dataviz Forest s...
Choropleth maps with geom_sf() | Professional dataviz with ggplot2 | R
มุมมอง 19K4 ปีที่แล้ว
5 minutes is enough to create a professional-looking and ready for publication chart. In this video i will show how to create a choropleth map using geom_sf() function from ggplot2 package. The choropleth in this video was created using population density data from Brazil's municipalities. The code and files can be found on my github repository: github.com/sergiocostafh/ggplot2_dataviz Forest s...

ความคิดเห็น

  • @Amis98
    @Amis98 2 หลายเดือนก่อน

    Thank you very much... May I kindly have your email address for further contact?

  • @Chale1288
    @Chale1288 2 หลายเดือนก่อน

    fuck ggplot2, this is by far more straightforward with base R.

  • @studentofeconomics.7841
    @studentofeconomics.7841 7 หลายเดือนก่อน

    how did you select the extent for South America??

  • @sandralissete9009
    @sandralissete9009 11 หลายเดือนก่อน

    Hola ami me sale error en scale_fill_manual(name='',values=c('darkred','steelblue'))+ .... Error in `palette()`: ! Insufficient values in manual scale. 10 needed but only 2 provided.

  • @habtamuabay9656
    @habtamuabay9656 ปีที่แล้ว

    how to fix "Error in `geom_sf()" in r

  • @samuelvitor2424
    @samuelvitor2424 ปีที่แล้ว

    Show de bola

  • @andresvinueza1992
    @andresvinueza1992 ปีที่แล้ว

    Gracias, tras una tarde buscando esto lo encontre resumido en 5 minutos.

  • @antoniocaicedobaltodano6724
    @antoniocaicedobaltodano6724 ปีที่แล้ว

    Hola, qué sucede? climate <- crop(climate,extent(-82,-34,-60.15)) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘crop’ for signature ‘"list"’

  • @jimmypratama3678
    @jimmypratama3678 2 ปีที่แล้ว

    why when i use the geom_line its always error, its says "Each group consists of only one observation."

  • @libradososa5394
    @libradososa5394 2 ปีที่แล้ว

    Genial, definitivamente muy útil!! Gracias. Thanks!!

  • @ahmed007Jaber
    @ahmed007Jaber 2 ปีที่แล้ว

    thank you for this; I am trying to visulaise the below but I am getting straight lines connected in the same year. any idea how to fix it? world_bank_pop %>% # tibble() %>% # janitor::clean_names() %>% pivot_longer(cols = 3:20, names_to = "date_data", values_to= "num_values") %>% tibble() %>% head(100) %>% ggplot(aes(date_data, num_values, groups = country)) + # geom_line()+ geom_point()

  • @paulosergiopansesilveira9556
    @paulosergiopansesilveira9556 2 ปีที่แล้ว

    It is a great help. Thank you. I am newbie in maps and raster... I am intending to create some with my own data (it seems hard to understand) instead of use raster maps already available in the Web. May I suggest I video for the initial steps in raster creation and adjust on a geographic map (e.g., epidemiological data)?

  • @Lala-eh7mr
    @Lala-eh7mr 2 ปีที่แล้ว

    how could the propec scale becomes minus 2.5 till positiive 2.5 , i mean it supposed to be percentages so it couldnt be negative, is the propec for male supposed to be *minus 100? ( i asked) because i literally copy your syntax but my plot turned to be basic stack bar plot

    • @sergiocosta6151
      @sergiocosta6151 2 ปีที่แล้ว

      I I mentioned this error in the description of the video and I made available the code that corrects the negative values ​​in the scale. Check te code on my github github.com/sergiocostafh/ggplot2_dataviz/blob/master/Population%20pyramid%20chart%20with%20geom_bar().R

  • @rafaafeitos
    @rafaafeitos 2 ปีที่แล้ว

    Ficou showwww

  • @xinking2644
    @xinking2644 2 ปีที่แล้ว

    wow, beautiful plot. thank you

  • @Z_blessed2024
    @Z_blessed2024 2 ปีที่แล้ว

    Wow! Thank you so much !

  • @vincenzo4259
    @vincenzo4259 2 ปีที่แล้ว

    Thanks

  • @vincenzo4259
    @vincenzo4259 2 ปีที่แล้ว

    Thanks

  • @isispetrocelli5495
    @isispetrocelli5495 3 ปีที่แล้ว

    Amazing tutorial, helped me to make mz raster points looks great

  • @asrimaharani3289
    @asrimaharani3289 3 ปีที่แล้ว

    Why mine said could not find function ggplot

  • @danielneri6281
    @danielneri6281 3 ปีที่แล้ว

    Thanks :)

  • @wanglisong5764
    @wanglisong5764 3 ปีที่แล้ว

    Fantastical tutorial, best one!

  • @IOOPLorenz
    @IOOPLorenz 3 ปีที่แล้ว

    estaba buscando este video, un diez

  • @purbashachowdhury2985
    @purbashachowdhury2985 3 ปีที่แล้ว

    Hi, I need to plot map of an Indian state. Would you please help me?

    • @prashantshekhar1012
      @prashantshekhar1012 3 ปีที่แล้ว

      Yes I can help

    • @purbashachowdhury2985
      @purbashachowdhury2985 3 ปีที่แล้ว

      @@prashantshekhar1012 thank U so much for replying! Can we connect(gmeet) ASAP? plz let me know your email!

  • @IrinaLizunova-q4l
    @IrinaLizunova-q4l 3 ปีที่แล้ว

    It's REALLY the best video about graphics on R. i loveeee it!!! thank you sooo much !!

  • @SmoothCode
    @SmoothCode 3 ปีที่แล้ว

    This is the kind of coding tutorials I would pay for.

  • @SmoothCode
    @SmoothCode 3 ปีที่แล้ว

    Awesome video! Please do more step-by-step R data visualization tutorials!

  • @filmonafewerki7884
    @filmonafewerki7884 3 ปีที่แล้ว

    Bravo!!! Lol, thanks for sharing.

  • @ProfBoggs
    @ProfBoggs 3 ปีที่แล้ว

    Thank you for posting a technique that divides the number of males in a cohort by TOTAL population, and number of females in a cohort by TOTAL population. I have seen numerous webpages and TH-cam videos who divide male or female cohort by the total male or female population. Also, thank you for this coding demonstration. This is exactly what I needed.

  • @alifashraff8297
    @alifashraff8297 3 ปีที่แล้ว

    Thanks bro, lu mmg mantap...

  • @eloyjuniorrezende2196
    @eloyjuniorrezende2196 3 ปีที่แล้ว

    Top demais! voce foi bem em tudo até na música, pra acalmar a turma desesperada por informações! Thaks a lot

  • @juancarlosroa8761
    @juancarlosroa8761 4 ปีที่แล้ว

    Amazing!!, Can I add geom_point on geom_sf() ?

  • @IrakliKavtaradzepsyche
    @IrakliKavtaradzepsyche 4 ปีที่แล้ว

    Thank you very much! One question, when you export it as pdf, can you modify each element of the map in photo editing app (illustrator)?

    • @AndyArthur
      @AndyArthur 3 ปีที่แล้ว

      You would be better off to export as svg for editing

  • @roshnipuli8553
    @roshnipuli8553 4 ปีที่แล้ว

    where did you get the preciptation data from?

  • @emrecanaksakal8307
    @emrecanaksakal8307 4 ปีที่แล้ว

    How can i add value for grid?

  • @Flavio_Marchi
    @Flavio_Marchi 4 ปีที่แล้ว

    Muito bom! Me ajudou bastante esses mapas do Brasil.

  • @maksim0933
    @maksim0933 4 ปีที่แล้ว

    Very nice code! Thanks! However, generally accepted for females - on right, males - on left. But this may vary in different scientific societies.

    • @ProfBoggs
      @ProfBoggs 3 ปีที่แล้ว

      You are correct. At least in English-language demography publications, males are on the left and females are on the right.

    • @mubangansofu7469
      @mubangansofu7469 2 ปีที่แล้ว

      Fantastic video.. please note tidyverse contains ggplot2 library so loading tidyverse is enough.

  • @igorakcio
    @igorakcio 4 ปีที่แล้ว

    Thank you, very much. Your video allowed me to finaly understand and plot the choropleth

  • @jasonrobin7306
    @jasonrobin7306 4 ปีที่แล้ว

    I don't understand how the url link works.

  • @maksim0933
    @maksim0933 4 ปีที่แล้ว

    why viridis library not loaded in the beginning?

  • @maksim0933
    @maksim0933 4 ปีที่แล้ว

    Great lesson) one little question: how to add a custom (not OSM) base map for aesthetic purposes?

  • @dilshadsaeed2857
    @dilshadsaeed2857 4 ปีที่แล้ว

    when I run climate=raster::getData('worldclim', var='bio',res=2.5) I get error : Could not download file -- perhaps it does not exist Error in file(con, "r") : cannot open the connection In addition: Warning messages: 1: In utils::unzip(zipfile, exdir = dirname(zipfile)) : error 1 in extracting from zip file 2: In file(con, "r") : cannot open file 'C:/Users/Hi/Documents/wc2-5/bio1.hdr': No such file or directory

  • @johannamartinez5463
    @johannamartinez5463 4 ปีที่แล้ว

    Qué buenos videos!!!!!!

  • @annestephen3174
    @annestephen3174 4 ปีที่แล้ว

    Hello, How can i get the data you are using on this clip. Great Work.

    • @sergiocosta6151
      @sergiocosta6151 4 ปีที่แล้ว

      The data is in the base package `datasets`. Just load the package and type `Orange` to see it, as shown in the video.

  • @epoxiconazole1
    @epoxiconazole1 4 ปีที่แล้ว

    So many infos in one video !! Great. Thank you.

  • @joshuadelabruere4262
    @joshuadelabruere4262 4 ปีที่แล้ว

    FYI the gather() and spread() from dplyr have been depreciated. Use pivot_longer() and pivot_wider() as these can accomplish the same result, with clearer syntax.

    • @sergiocosta6151
      @sergiocosta6151 4 ปีที่แล้ว

      Thanks for the contribution, i accepted your pull request on github.

  • @jd-hb9pe
    @jd-hb9pe 4 ปีที่แล้ว

    Brilliant video. Thanks Sergio!

  • @danielvalentins1756
    @danielvalentins1756 4 ปีที่แล้ว

    Very beautiful map! there is a package called 'brazilmaps', with this package you don't need to download the shapefiles, take a look. Looking forward to more videos, good job!

  • @wenliiding6879
    @wenliiding6879 4 ปีที่แล้ว

    trying URL 'biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip' Content type 'application/zip' length 129319755 bytes (123.3 MB) ======= downloaded 19.6 MB Error in utils::download.file(url = aurl, destfile = fn, method = "auto", : download from 'biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip' failed In addition: Warning messages: 1: In utils::download.file(url = aurl, destfile = fn, method = "auto", : downloaded length 20594688 != reported length 129319755 2: In utils::download.file(url = aurl, destfile = fn, method = "auto", : URL 'data.biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip': status was 'Failure when receiving data from the peer' It seems like that I could not download the data

  • @chrisharrod7771
    @chrisharrod7771 4 ปีที่แล้ว

    I hit a bot of a problem with > rasdf <- as.data.frame(raster,xy=TRUE)%>%drop_na(raster) Produced the following: Error in drop_na(., raster) : could not find function "drop_na"...

    • @sergiocosta6151
      @sergiocosta6151 4 ปีที่แล้ว

      load tidyverse package to enable drop_na() function

    • @antonelladiane
      @antonelladiane 4 ปีที่แล้ว

      Otherwise na.omit(your dataframe)