Spencer Schien
Spencer Schien
  • Видео 15
  • Просмотров 36 939
Rayshader Tutorial: Acadia National Park Shaded Relief Map
This is a live coding tutorial where I show how to us the {rayshader} package in R to create a 3D shaded relief map. Acadia National Park serves as an example. Full code available here: github.com/Pecners/rayshader_portraits.
Просмотров: 350

Видео

L'Hexagone en Tour Eiffel
Просмотров 1039 месяцев назад
This fun video show mainland France represented by a hexagonal grid that blinks to simulate the blinking of the Eiffel Tower. France is sometimes called "The Hexagon" (L'Hexagone in French) because it's shape roughly resembles a hexagon. #france #satisfying
Tidyverse tip: Create percentage column with multi-level grouping
Просмотров 12311 месяцев назад
My last video showed how to add a summary column with percentages, and in this video, I expand the example to do the same this with multi-level groups.
Tidyverse tip: easily create percentage column in R
Просмотров 1,3 тыс.11 месяцев назад
It's easy to create a summary column in R that shows percentages.
How to have your computer tell you when your R script finishes
Просмотров 130Год назад
This video shows how you can use the 'say' command on a Mac to make an R script speak when your R script is done.
Live Coding: Vermont Population Density (Part I)
Просмотров 513Год назад
This is a live coding session where I create a 3D population density map of Vermont. This video goes through the rendering process to create the high-quality graphic. Part II will cover adding annotations.
Join and Summarize Spatial Data
Просмотров 1,8 тыс.Год назад
This is an R coding tutorial that shows how combine and summarize spatial data. Specifically, I show how you can take lat-long coordinates, convert them to spatial objects, and join and summarize them with spatial polygons. I show both pre-defined polygons (French Departments) as well as user-created polygons (hexagonal grid). The example I use takes French winery locations from OpenStreetMap d...
Live Coding: Population Density along the Seine
Просмотров 7 тыс.Год назад
This is a live coding video that shows my process for creating these sorts of graphics. This is not intended to be a tutorial, and I don't explain things in great detail.
Double group on x axis with ggplot
Просмотров 3,7 тыс.Год назад
This is a live coding tutorial that shows how you can create a plot that has two levels of groupings along the x axis. This is done by using facets, but hiding all the traditional trademarks of the facet panels. Code can be found here: github.com/Pecners/penguins_facet_live_coding 2:31 Create R Project 4:02 Install Download {palmerpenguins} 6:04 Summarize Data 8:03 Start Plotting 11:28 Add Face...
Rayshader Tutorial-Florida Population Density
Просмотров 21 тыс.Год назад
This is a live-coding tutorial that walks through how to create a 3D population density map in R using the rayshader package. The example uses Kontur Population data for the state of Florida. Code from this tutorial is available here: github.com/Pecners/kontur_rayshader_tutorial NOTE: Before starting, I recommend you install the latest dev versions of rayshader and rayrender to avoid an error t...

Комментарии

  • @chooby364
    @chooby364 20 дней назад

    I have a similar case where one of my species category (lets assume Gentoo) has only lenght measurements. When I plot I get depth and length labeling to appear under Gentoo but actually there is no depth barplot. How can I tell R Studio to delete the depth barplot for that specific Gentoo species? Thanks in advance

  • @sagarrawal8332
    @sagarrawal8332 Месяц назад

    I used following code to add label and label appears in snippet but whenever i use render_highquality, the text label don't appear and is replaced by rectangular box with black color in place of text. i.imgur.com/enW9d47.png render_label(elev_matrix, lat =27.663, long =85.29765, extent=attr(elev_img, "extent"), freetype=T, zscale = 6, text = "My label", textcolor = "Black" dashed = F, textsize = 1, linewidth = 2, linecolor="Darkorange")

  • @sagarrawal8332
    @sagarrawal8332 Месяц назад

    Did i miss something in tutorial ? How that 400 meter ( 1/4th mile) was calcualted ?

    • @MrPecners
      @MrPecners Месяц назад

      It’s not calculated in the video, that’s provided by the data source, Kontur.

    • @sagarrawal8332
      @sagarrawal8332 Месяц назад

      @@MrPecners Thank you. The tutorial was indeed very helpful.

    • @sagarrawal8332
      @sagarrawal8332 Месяц назад

      @@MrPecners How to add scale to show the density value of minimum and maximum density ?

    • @sagarrawal8332
      @sagarrawal8332 Месяц назад

      @@MrPecners Is there a way to add color bar with range of matrix using same texture as in plot?

  • @SyarmineS
    @SyarmineS 5 месяцев назад

    Been doing this and at only at 58:24 you just mentioned you are on Macbook Pro. hahaha

  • @alexvm8352
    @alexvm8352 5 месяцев назад

    What’s the difference between the matrix size and the high quality render size(width/height)?

  • @Pongant
    @Pongant 6 месяцев назад

    What an amazing package.

  • @yashwanthermann
    @yashwanthermann 7 месяцев назад

    Do you have a guide to this?

    • @MrPecners
      @MrPecners 7 месяцев назад

      I have tutorials where I walk through the whole process of creating visuals like this. This one is a good starting place: ruclips.net/video/zgFXVhmKNbU/видео.html.

  • @jensonvictor84
    @jensonvictor84 7 месяцев назад

    Thank you very much... this was very helpful

  • @ozmenmedine
    @ozmenmedine 8 месяцев назад

    Hi Spencer! Thank you very much for your amazing tutorial! I would like to try this. However, I need your help :) In the beginning, you downloaded the states with "tigris" package, but as I understand this is special for the USA. So, how can I download it to Turkey's states? Could you help me, please? Because I am a beginner at this.. Many thanks.. Medine

    • @MrPecners
      @MrPecners 8 месяцев назад

      Hi Medine, thanks for your message! You can use the {geodata} package. For instance, here's some code to get you started: turkey <- geodata::gadm("TUR", level = 1, path = tempdir()) |> st_as_sf()

  • @larissamuller3423
    @larissamuller3423 9 месяцев назад

    So amazing! I was wondering if you ever use the threejs package in R to show these datasets on a global 3d map. I have been trying to translate these datasets with that package but I have been having a difficult time. So if you are familiar, I would love to see a tutorial on that!

  • @sayedrohullahkazemi6157
    @sayedrohullahkazemi6157 9 месяцев назад

    Amazing work, thank you.

  • @RoshniAgarwal-lp2fv
    @RoshniAgarwal-lp2fv 10 месяцев назад

    the states function we use from tigris package only loads the states of USA. is there any similar package for India? or how do we go about it while plotting the map of India?

  • @johneagle4384
    @johneagle4384 10 месяцев назад

    Wow. Cool Stuff. Impressive. Thank you.

  • @MN-ly9mw
    @MN-ly9mw 10 месяцев назад

    Can these be done on Python? I have started to learn Python. Again learning a new language might not be possible for me at this point in life 😢

    • @MrPecners
      @MrPecners 10 месяцев назад

      I would guess there’s a way to do this with python, but I don’t know exactly what libraries to use. Rayshader leverages OpenGL, so maybe some python libraries that utilize that tool would be a place to look?

  • @konstantinosiliakis8290
    @konstantinosiliakis8290 11 месяцев назад

    can we put some gpu acceleration on this? my cpu is dying

  • @user-vw2dt6py2b
    @user-vw2dt6py2b 11 месяцев назад

    thank you so much for this! is there any way to make three levels??

  • @datanerdid1918
    @datanerdid1918 Год назад

    Great tutorial. You can use ggview package to check the right size of graph before saving it. Cheers.

  • @ahmed007Jaber
    @ahmed007Jaber Год назад

    nice one. I tried it but it keeps printing 127 with no auditable feedback

  • @MuhammadZubair-yd9ev
    @MuhammadZubair-yd9ev Год назад

    i am getting error like admin is not found

  • @man0utoftime
    @man0utoftime Год назад

    Very easy to follow along.

  • @bisyrim1030
    @bisyrim1030 Год назад

    hello friend I have tried many time to run wineries but it's always end in fail. I don't know how to fix this. 18:00

  • @bisyrim1030
    @bisyrim1030 Год назад

    your voice is so small. please provide the video with good quality of audio either

    • @man0utoftime
      @man0utoftime Год назад

      Yeah. He needs to embiggen that voice.

  • @shaikhahmedbd
    @shaikhahmedbd Год назад

    I can't render in high quality. Tried after updating rayshader & rayrender, still didn't work! > render_highquality( + filename = "images/test_plot.png" + ) Error in rayrender::obj_model(cache_filename, x = -bbox_center[1], y = -bbox_center[2], : unused argument (texture = TRUE)

  • @leekwangchun
    @leekwangchun Год назад

    It's awesome!!!

  • @vilderislunsj
    @vilderislunsj Год назад

    Great video. I am a beginner in mapping and plotting with R, so I was wondering - is this possible for non-count data? Lets say you wanted to make the same map but with litres of wine produced per cell/geographic area. I'm assuming you'd need an assigned value to each point and somehow sum all point values within each geographic boundary. Is it possible at all or do you have to use another type of method to produce the same maps?

    • @MrPecners
      @MrPecners Год назад

      It's possible to do what you describe with basically the same method. You would just swap out the count with a sum of the variable in question. For your example, if each winery had the liters of wine for each winery, you could group by cell and summarize total number of liters in that cell.

    • @vilderislunsj
      @vilderislunsj Год назад

      @@MrPecners thank you - I’m going to try it out with some data I have as soon as possible!

  • @nevinthomas5130
    @nevinthomas5130 Год назад

    Hi there, I have just started the tutorial and noticed that the memory usage increases to 6GB or more when reading the data. Is it necessary to have a good CPU and RAM for this tutorial? (my system specs: i5, 4 cores, 16GB RAM.)

    • @MrPecners
      @MrPecners Год назад

      You will probably struggle to complete the tutorial doing everything the same as I do because it is pretty memory intensive. You should be able to get through it by keeping everything smaller and lower resolution.

    • @nevinthomas5130
      @nevinthomas5130 Год назад

      @@MrPecners Thanks for the reply

  • @atheeralhejaily9816
    @atheeralhejaily9816 Год назад

    can you please make the kontur rayshader plot using the same data in this video?

  • @pdcoronado
    @pdcoronado Год назад

    Que buen material. Espero con ansias el video y los datos que utilizas para replicarlo

  • @merzougahmed4248
    @merzougahmed4248 Год назад

    Thank you so much. I am taking the approach for applications in the oil and gas industry. Could you please show me how to keep the contour of the state map plotted? thanks

    • @MrPecners
      @MrPecners Год назад

      Very cool! Here's an example script that you can reference to achieve that, see lines 41-53: github.com/Pecners/rayshader_portraits/blob/main/R/portraits/montana/render_graphic.R

  • @lalitb
    @lalitb Год назад

    Please upload video of some small country, the Florida data you did on another video my laptop couldn't process that.

  • @pujaadityawinata
    @pujaadityawinata Год назад

    What an amazing visualization! This inspired me to make my own visualization. Everything is going well when i working with maps that have width > height, i can get the visualization. But when i'm working with maps that have height > width, i got an error in ph_rast <- st_rasterize(st_ph, nx = floor(size * w_ratio), ny = floor(size * h_ratio)) it's say "Error in UseMethod("units") : no applicable method for 'units' applied to an object of class "c('double', 'numeric')" i really appreciate it if u could help me with this error. Thanks!

  • @user-fp6ng5fx6p
    @user-fp6ng5fx6p Год назад

    Hi Spencer, Thanks a lot for the great video and template code. I ran a few examples and that worked fine. Of course, always time-consuming to find the ideal angles / lighting and resolutions while avoiding crashes. I would have a question related to the height and width. You mention that the unit is in meters based on st_crs(data), but I have some doubts. For Switzerland I get height = 325'262.5m, but Switzerland is only roughly 220km North-South. Could you please clarify?

  • @nikkzm3689
    @nikkzm3689 Год назад

    Hi, I am getting error while I am executing the st_read() for gpkg file of France's population. " The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats. " Can anyone please tell me how to fix this error? Thank You.

  • @eylonshahar2979
    @eylonshahar2979 Год назад

    Thank you very much! I'm trying to make a map of Israel but I'm having some difficulties. First : Warning in matrix(israel_rast, nrow = floor(size * w_ratio), ncol = floor(size * : data length [30] is not a sub-multiple or multiple of the number of rows [994] and then: > mat |> + height_shade() |> + plot_3d(heightmap = mat) Error: vector memory exhausted (limit reached?) What should i do?

  • @user-uv5rp8fw4b
    @user-uv5rp8fw4b Год назад

    Reading (data <-st_read) layer population not working, Could anyone help me.

  • @burakt
    @burakt Год назад

    Hi Spencer, It gives the warning --> package ‘MetBrewer’ was built under R version 4.2.3 What should I do.

  • @faraazali9589
    @faraazali9589 Год назад

    Hi Spencer, great tutorial. Im getting the following error on Win 11: mat |> + height_shade(texture=texture) |> + plot_3d(heightmap = mat, + zscale = 6, + background = "#fff8f2", + solid="FALSE", + shadowdepth=0 + ) Error in solid && !triangulate : invalid 'x' type in 'x && y' In addition: Warning messages: 1: 'rgl.surface' is deprecated. Use 'surface3d' instead. See help("Deprecated") 2: 'rgl.viewpoint' is deprecated. Use 'view3d' instead. See help("Deprecated")

  • @ketevanikapanadze7476
    @ketevanikapanadze7476 Год назад

    Thank you so much! Amazing content. Your code works perfectly on my windows environment but could not finalise on my Mac. At the last point when I try to visualise and save the output I am getting the following error, I tried literally everything but could not succeed. Any ideas/suggestions? Thanks! Error in render_highquality(filename = outfile, interactive = FALSE, lightdirection = 280, : No rgl window currently open.

  • @quazisyedziaulhasanzishan7493

    awesome tutorials sir, What it alternative for tigers package for Indian states.

  • @karytsi
    @karytsi Год назад

    when executing: mat |> height_shade(texture = texture)|> plot_3d(heightmap = mat, zscale = 80, solid = FALSE, shadowdepth = 0) I get this: Warning messages: 1: 'rgl.surface' is deprecated. Use 'surface3d' instead. See help("Deprecated") 2: 'rgl.viewpoint' is deprecated. Use 'view3d' instead. See help("Deprecated") 3: 'rgl.triangles' is deprecated. Use 'triangles3d' instead. See help("Deprecated") have R 4.2.3 installed... and remotes rayshader... any ideas?

  • @arieldome530
    @arieldome530 Год назад

    Hello can you help me how to correct this error? Error in rayrender::obj_model(cache_filename, x = -bbox_center[1], y = -bbox_center[2], : unused argument (texture = TRUE)

    • @lcsl5605
      @lcsl5605 Год назад

      Same problem here. I updated rayrender and rayshader

  • @philippsidler2408
    @philippsidler2408 Год назад

    Awesome 👏🏻 thanks. Could you do at some point a tutorial how to additionally add mountain reliefs? Living in Switzerland so that would be pretty cool

    • @MrPecners
      @MrPecners Год назад

      Encoding both population density and elevation to the height axis can make it very hard to interpret. Here's one example I know of: twitter.com/researchremora/status/1630318714343047171

    • @philippsidler2408
      @philippsidler2408 Год назад

      🙏🏻

  • @lbarq
    @lbarq Год назад

    Awesome content. How would you label/identify with text on the map the cities of florida? Thanks

    • @MrPecners
      @MrPecners Год назад

      There technically is a way to do this with Rayshader, but I prefer to do labeling post-render. I use imagemagick (through the R {magick} package) to add text annotations, and I would do the same to add those labels. That requires manual label placement, though...

  • @rajshekarreddy5358
    @rajshekarreddy5358 Год назад

    Please help me, I'm unable to load the data after downloading into Rstudio.

  • @DataOperationsandResearch
    @DataOperationsandResearch Год назад

    Hello everyone. If you guys are working on Windows with R 4.2 and the Rstudio crashes/terminates when you run mat |> height_shade(texture = texture) |> plot_3d(heightmap = mat, zscale = 100 ) Then you should use solid = FALSE in the above function and Rstudio would not terminate. So, use the function mat |> height_shade(texture = texture) |> plot_3d(heightmap = mat, zscale = 100, solid = FALSE, ) This problem could be specific to operating system and/or Rstudio/R version. But both I and my colleague faced this issue and it was a working fix. Lastly, great work @Spencer Schien. Wonderful video, keep up the good work.

  • @keshavchadha80
    @keshavchadha80 Год назад

    Hello Spencer, like Tigris package is specifically for US Shapefile. Can you help me with the package solely for Indian shapefile?

  • @camilatotti2843
    @camilatotti2843 Год назад

    Thanks so much for your tutorials, it's been amazing learning 3d viz in R with them!

  • @abhisheknayak2088
    @abhisheknayak2088 Год назад

    This is amazing. Can you making a video of converting ggplot to 3d using rayshader. I was trying to convert pie chart but was facing this error (Discrete value supplied to continuous scale). Thanks in advance

  • @camilaberger2980
    @camilaberger2980 Год назад

    You are amazing, great project!!!! And thank you to share your knowledge

  • @kevinalexis9886
    @kevinalexis9886 Год назад

    Is anyone familiar with the following ERROR: Error in c.units(x = nx[[1L]], y = ny[[1L]]) : units are not convertible, and cannot be mixed; try setting units_options(allow_mixed = TRUE)?

    • @MrPecners
      @MrPecners Год назад

      Wrapping w_ratio and h_ratio in as.numeric() should solve this.

    • @kevinalexis9886
      @kevinalexis9886 Год назад

      I tried using the both solutions mentioned before: units_options(allow_mixed = TRUE) and drop_units(w_ratio) Without any success Im now getting the following ERROR: Error in stopifnot(is.character(values), is.numeric(x)) : argument "values" is missing, with no default