R: test R Markdown
3:17
10 ай бұрын
Python: pandas tutorial || 08
34:26
2 жыл бұрын
Python: numpy tutorial || 07
28:02
2 жыл бұрын
R: Python's f-string in R? || 22
2:12
Пікірлер
@tidjanicisse603
@tidjanicisse603 Ай бұрын
thanks
@ssadiq507
@ssadiq507 Ай бұрын
thank q
@venkat2132
@venkat2132 3 ай бұрын
Thank you so much this helped me in a complex me json
@labtimeRP
@labtimeRP 3 ай бұрын
@@venkat2132 I am glad It was helpful!
@navpreetkaur9091
@navpreetkaur9091 3 ай бұрын
in two column format will it work?
@labtimeRP
@labtimeRP 3 ай бұрын
Yes, you can adapt it
@navpreetkaur9091
@navpreetkaur9091 3 ай бұрын
I am using long table in twocolumn format, but it is not spanned to next page
@sabahhegazy7606
@sabahhegazy7606 5 ай бұрын
Please provide me with a clear code description!
@Lothian85
@Lothian85 5 ай бұрын
When calculating the Relative Strength Index (RSI), if AvgDown (the average of downward price changes) is zero, it can indeed result in a division by zero, which will produce NaN (Not a Number) values.
@Lothian85
@Lothian85 5 ай бұрын
It was helpful. Thank you very much!
@cathygoltsoff9615
@cathygoltsoff9615 6 ай бұрын
Thank you
@chroy_
@chroy_ 7 ай бұрын
Thank you, this will help me write proper documentation and procedures for my job, and now I wont need to fumble with word >_<*
@carlokappler5035
@carlokappler5035 8 ай бұрын
Hello, where is the code available ?
@gottapupavan3503
@gottapupavan3503 8 ай бұрын
Can I get that cide please
@labtimeRP
@labtimeRP 8 ай бұрын
# file aux_gdp_plot.R: library("readxl") # import Excel files into R library("curl") # connection interface library("tidyr") # data management library("dplyr") # data management library("ggplot2") # plot library("scales") # graphical tools # World Bank GDP ---- ## "data.worldbank.org/indicator/NY.GDP.MKTP.CD" ## link in the description url <- "api.worldbank.org/v2/en/indicator/NY.GDP.MKTP.CD?downloadformat=excel" destfile <- "NY_GDP_MKTP.xls" curl::curl_download(url, destfile) GDP <- read_excel(destfile, skip = 2) gdp <- GDP gdp <- gdp[, c(-2, -3, -4)] colnames(gdp)[1] <- "Country" # wide => long with pivot_longer() (tidyr) ---- gdp_l <- gdp %>% pivot_longer(!Country, # all columns but not country names_to = "year", values_to = "GDP") # file app.R #' In this video we write an app to plot countries' GDP by using World Bank data library("shiny") source("aux_gdp_plot.R", local = TRUE) # Define UI for application ui <- fluidPage( # Application title titlePanel("GDP per country, 1960 ~ , World Bank Data"), # first row divided in 2 parts fluidRow( column(6, selectInput("country", "Select Countries: ", choices = gdp$Country, multiple = TRUE, width = "100%")), column(6, selectInput("year", "Select year: ", choices = unique(gdp_l$year), multiple = TRUE, width = "100%"))), # second row with one part fluidRow(column(12, actionButton("p", "Plot", class = "btn-block"))), # third row with 2 parts fluidRow(column(8, plotOutput("distPlot", brush = "plot_brush")), column(4, tableOutput("data"))) ) # Define server logic required to draw a line plot with ggplot2 server <- function(input, output) { out <- eventReactive(input$p, { req(input$country, input$year) df <- subset(gdp_l, Country %in% input$country & year %in% input$year) }) output$distPlot <- renderPlot({ ggplot(out(), aes(x = year, y = GDP, group = Country, color = Country)) + geom_line(size = 1) + scale_y_continuous(labels = scales::dollar, breaks = pretty_breaks()) + scale_x_discrete(breaks = pretty_breaks()) + theme_classic() + theme(legend.position = "bottom", legend.title = element_blank()) }, res = 96) output$data <- renderTable({ brushedPoints(out(), input$plot_brush) }) } # Run the application shinyApp(ui = ui, server = server)
@slya5720
@slya5720 Жыл бұрын
Extremely useless video. I have learned absolutely nothing after watching this
@yasamanjafari9712
@yasamanjafari9712 Жыл бұрын
All of your videos are awesome! Thank you....
@labtimeRP
@labtimeRP Жыл бұрын
Thank you very much!
@yasamanjafari9712
@yasamanjafari9712 Жыл бұрын
Hi Thanks for this video, it's so good! Just a problem, my photos won't be added to the map. And after running that part of the code even location points disappear. What's wrong with my map?
@labtimeRP
@labtimeRP Жыл бұрын
Hi, thank you! I understand that if you don't add the photos you get the expected result. If you add the images the location points disappear but the images are not loaded. But you don't get any error message. Is that correct? Is that possible that they are overlapping the location point but they are not shown? If so, double check the path to the images and their format. Please let me know if you solve it
@yasamanjafari9712
@yasamanjafari9712 Жыл бұрын
@@labtimeRP This is my code: #Let's add icon photos: iconSet <- iconList( BRL_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Olympiastadion (Berlin) .jpg ", 80,80), MUN_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Allian Arena (Munich).jpg ", 80,80), DRT_stadium = makeIcon(makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Signal-Iduna Park (Dortmund) .jpg ", 80,80)), STU_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Mercedes Benz Arena (Stuttgart).jpg ", 80,80), GEN_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Veltins-Arena (Gelsenkirchen).jpg ", 80,80), FRF_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Deutsche Bank Park (Frankfurt).jpg ", 80,80), HAM_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Volksparkstadion (Hamburg).jpg ", 80,80), KAI_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Fritz-Walter Stadion (Kaiserslautern).jpg ", 80,80), COL_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Rhein-Energie Stadion (Cologne).jpg ", 80,80), HAN_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/HDI Arena (Hannover).jpg ", 80,80), LEI_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Red Bull Arena (Leipzig).jpg ", 80,80), NUR_stadium = makeIcon("~/Yas-New-Directory-Aus/German_Photos/German_Stadiums/Max-Morlock Stadion (Nuremberg).jpg ", 80,80) ) leaflet()%>% addTiles()%>% addMarkers(lng = GER_stadium$lng, lat = GER_stadium$lat, icon = iconSet)%>% addProviderTiles(provider = "Stamen") It still won't show images! Not even location points.
@labtimeRP
@labtimeRP Жыл бұрын
Hi, I solved it. It was giving the same problem to me. I think it is due to an update. Use the following code: iconSet <- list( BRL_stadium = "germany_stadium/berlin_stadium.jpg", MUN_stadium = "germany_stadium/munich_stadium.jpg", DRT_stadium = "germany_stadium/dortmund_stadium.jpg", STU_stadium = "germany_stadium/stuttgart_stadium.jpg", GEN_statium = "germany_stadium/gelsenkirchen_stadium.jpg", FRF_stadium = "germany_stadium/frankfurt_stadium.jpg", HAM_stadium = "germany_stadium/hamburg_stadium.jpg", KAI_stadium = "germany_stadium/kaiserslautern_stadium.jpg", COL_stadium = "germany_stadium/cologne_stadium.jpg", HAN_stadium = "germany_stadium/hannover_stadium.jpg", LEI_stadium = "germany_stadium/leipzig_stadium.jpg", NUR_stadium = "germany_stadium/nuremberg_stadium.jpg" ) leaflet() %>% addTiles() %>% addMarkers(data = GER_stadium[, 3:4], icon = ~ icons( iconUrl = iconSet, iconWidth = 80, iconHeight = 80 )) Let me know if it works for you as well
@yasamanjafari9712
@yasamanjafari9712 Жыл бұрын
@@labtimeRP Running the last part shows me this error: Error in guessLatLongCols(names(obj)) : Couldn't infer longitude/latitude columns
@labtimeRP
@labtimeRP Жыл бұрын
@@yasamanjafari9712 in my data frame the columns have lat and lng as column names
@diazparvinacristhianaugust1570
@diazparvinacristhianaugust1570 Жыл бұрын
gracias por los ejemplos amigo, thanks for examples!
@unknown_user1987
@unknown_user1987 Жыл бұрын
Thank you for your great tutorial. Can you share the link for .ipynb file?
@labtimeRP
@labtimeRP Жыл бұрын
Hi, thank you. I do not have now the possibility to share it.
@LuckyTyNkosi
@LuckyTyNkosi Жыл бұрын
Hi, how can you make the game play automatically, maybe taking a list of coordinates, instead of inputing coordinates one by one
@labtimeRP
@labtimeRP Жыл бұрын
Hi, something like this? Use a recursive function to make R decide about the coordinates. Then pass them to the matrix and assign value 1
@insane2093
@insane2093 Жыл бұрын
Hey, Mine is nested json needs 2col and store it in dataframe .how to break this nested json i follow ur video till head and tail its works but my json type is dict. So next part not working .can you help me on this
@labtimeRP
@labtimeRP Жыл бұрын
Hi, did you watch video number 6 in the playlist? Is that video not helpful for your problem?
@guidosalmaso6513
@guidosalmaso6513 Жыл бұрын
Hi, nice video! I tried the Python style using VSC but it gave me errors, what can i do?
@labtimeRP
@labtimeRP Жыл бұрын
Hi, can you tell me the error you got?
@katlegomehlape8623
@katlegomehlape8623 Жыл бұрын
Please explain how the ships are put on the field again? how does R decide to place the ships?
@labtimeRP
@labtimeRP Жыл бұрын
Hi, the approach is very naive. A while loop runs as long as the sum of the 1s in the matrix in less than the value we choose for n. n is also the end of a sequence that is stored in s. In the while loop R extracts randomly with replacement a value for the i index and a value for the j index from the s sequence. This makes sure that the selection is in the margin of the matrix. A 1 is assigned to [i,j] every time the loop runs. When the sum of 1s in the matrix is equal to n the loop stops. In the second part of the video, I will explain it again.
@juanhuertapelaezdesoto
@juanhuertapelaezdesoto Жыл бұрын
Wheni try to turn the object into a tidy table, i ges the following EU_df <- tidy(EU, region = "NAME_O") Error in `[.data.frame`(attr, , region) : undefined columns selected why is that?
@labtimeRP
@labtimeRP Жыл бұрын
Hi, when you get "undefined columns selected" error means that you are trying to select columns that don't exist in the data frame. The error may be due to wrong position of the comma, wrong index number or column name, or the data frame created is wrong. I hope this helps
@robparungo
@robparungo Жыл бұрын
Do you have the codes to this video? Thanks
@labtimeRP
@labtimeRP Жыл бұрын
Hi, I pasted it below. I hope it is useful library("ggplot2") # to plot with ggplot library("sp") # coordinates library("raster") # geographic data analysis and modeling library("broom") # to make spatial obj into dataframe => to plot with ggplot # download geo data from GADM ---- jpn1 <- getData("GADM", country = "JPN", level = 1) # prefectures jpn2 <- getData("GADM", country = "JPN", level = 2) # town/city View(jpn1) head(jpn2) # plot with plot() plot(jpn1) plot(jpn2) # make data as data frame to plot with ggplot() ---- jpn1_df <- tidy(jpn1, region = "NAME_1") jpn2_df <- tidy(jpn2, region = "NAME_2") jpn2_df_try <- tidy(jpn2, region = "NAME_2", id = "GID_2") jpn2_df_try jpn2_df # generate some random values to plot ---- id <- unique(jpn2_df$id) id set.seed(123) rval <- sample(100:1000, length(id), replace = TRUE) df_city <- data.frame(id, rval) head(df_city) tail(df_city) df_city[which.max(df_city$rval), ] df_city[which.min(df_city$rval), ] # merge with jpn2_df by id ---- df <- merge(jpn2_df, df_city, by = "id") head(df) tail(df) # plot with ggplot() ---- ## plot prefectures ggplot() + geom_polygon(data = jpn1_df, aes(x = long, y = lat, group = group, fill = id)) + ggtitle("Japan Prefectures Map with ggplot2") + theme_void() + theme(legend.position = "none") ## plot cities ggplot() + geom_polygon(data = df, aes(x = long, y = lat, group = group, fill = id)) + ggtitle("Japan Metropolitan Map with ggplot2") + theme_void() + theme(legend.position = "none") ## overlap the two plots ---- ### plot random values at city level and overlap prefecture border lines ggplot() + geom_polygon(data = df, aes(x = long, y = lat, group = group, fill = rval)) + geom_polygon(data = jpn1_df, aes(x = long, y = lat, group = group), fill = "white", alpha = 0.1, color = "red") + ggtitle("Japan Cities & Prefectures Map with ggplot2") + theme_void() # Nakagawa plot ---- #' There are 4 Nakagawa cities #' in Fukuoka #' in Hokkaido #' in Nagano #' in Tochigi #' jpn2_df jpn2_df_try <- jpn2_df jpn2_df_try jpn2_df$newId <- ifelse(jpn2_df$group == "Nakagawa.1", "Hokkaido", ifelse(jpn2_df$group == "Nakagawa.2", "Tochigi", ifelse(jpn2_df$group == "Nakagawa.3", "Fukuoka", ifelse(jpn2_df$group == "Nakagawa.4", "Nagano", "NotNakagawa")))) jpn2_df jpn2_df$newId <- as.factor(jpn2_df$newId) ## plot Nakagawa ggplot() + geom_polygon(data = jpn2_df, aes(x = long, y = lat, group = group, fill = newId)) + ggtitle("Nakagawa cities in Japan") + theme_void() + coord_equal(xlim = c(130, 142), ylim = c(32, 44.5))
@KhasanovGumer
@KhasanovGumer 2 жыл бұрын
thank you very mach for great examples!!!
@labtimeRP
@labtimeRP 2 жыл бұрын
Thank you for appreciating my video 👍
@sanjanakhondaker887
@sanjanakhondaker887 2 жыл бұрын
Really need the codes
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, if you refer to the code for the set up of the file you can find it in the description box of the second video in the playlist. I hope it helps
@zen07476
@zen07476 2 жыл бұрын
Thanks for the video may i know how can i give path for my file (i am trying to open a python file but its not working )
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you for the comment. I would recommend that you place the python file in the folder where your tex file is located. The R file in the example is in the same folder. Usually, I organize files in folders in the same folder where the tex file is located. For an example, you may refer to the video about including figures in tex: kzbin.info/www/bejne/j4OZZoOOZsSnoM0 I hope it helps. I will discuss more about files organization in future video about how to write a thesis/book in LaTeX.
@mateomurillo4921
@mateomurillo4921 2 жыл бұрын
Ty <3
@Analyse_US
@Analyse_US 2 жыл бұрын
Thanks, great examples with a dataset that has an appropriate level of complexity to make it meaningful to apply to the real world
@labtimeRP
@labtimeRP 2 жыл бұрын
Thank you for your comment!
@Purnima_Chowdhury
@Purnima_Chowdhury 2 жыл бұрын
hi i cannot find chordDiagram in R.. can you help
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, chordDiagram is a function from the circlize package. Make it sure that the package is installed and loaded
@nurlitakholishotunnisa2974
@nurlitakholishotunnisa2974 2 жыл бұрын
Hello sir, can you share the syntax? because theres some error when i run it, and i dont know how to fix it:(
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, what kind of error do you get? Following the code library("shiny") library("ggplot2") library("quantmod") library("scales") library("dplyr") library("tidyr") library("tibble") library("TTR") # Define UI for application ui <- fluidPage( # Application title titlePanel("Stock Analysis"), # Sidebar sidebarLayout( sidebarPanel( textInput("ticker", "Ticker: "), dateInput("date", "Starting date: ", value = "2022-01-03"), selectInput("dateBreaks", "Date breaks: ", choices = c("1 day", "1 week", "1 month", "1 year")), selectInput("ma", "Moving average: ", choices = c("None", "SMA", "EMA", "WMA", "EVWMA", "VWAP")), numericInput("window", "window: ", value = 1), actionButton("button", "Compute", class = "btn-block") ), # Show plot and data mainPanel( fluidRow( column(12, plotOutput("candlePlot", brush = "plot_brush")) ), fluidRow( column(12, tableOutput("data")) ) ) ) ) # Define server logic server <- function(input, output, session) { stock <- eventReactive(input$button, { req(input$ticker, input$date, input$ma, input$window) getSymbols(input$ticker, from = input$date, auto.assign = FALSE) %>% na.locf() %>% as.data.frame() %>% `colnames<-`(c("open", "high", "low", "close", "volume", "adjusted")) %>% rownames_to_column(var = "date") %>% mutate(date = as.Date(date)) %>% mutate(greenRed=ifelse(open-close>0, "Red", "Green")) %>% mutate(movAvg = case_when( # new code to compute MA input$ma == "SMA" ~ SMA(close, input$window), input$ma == "EMA" ~ EMA(close, input$window), input$ma == "WMA" ~ WMA(close, input$window), input$ma == "EVWMA" ~ EVWMA(close, volume, input$window), input$ma == "VWAP" ~ VWAP(close, volume, input$window) )) } ) cp <- eventReactive(input$button, { req(input$ticker, input$date, input$dateBreaks) # Code for candlestick plot with ggplot2 from: # www.r-bloggers.com/2021/09/robservations-12-making-a-candlestick-plot-with-the-ggplot2-and-tidyquant-packages/ ggplot(stock()) + geom_segment(aes(x = date, xend = date, y = open, yend = close, colour = greenRed), size = 3) + geom_segment(aes(x = date, xend = date, y = high, yend = low, colour = greenRed)) + geom_col(aes(x = date, y = (((max(close) - min(close)) * ((volume - min(volume)) / (max(volume) - min(volume)))) + min(close))), # To constrain volume to be in the range of close: (((max(new) - min(new)) * ((x - min(old)) / (max(old) - min(old)))) + min(new))), fill = "red", alpha = 0.1) + theme_bw() + scale_color_manual(values = c("Forest Green","Red")) + labs(title = paste0(input$ticker, ": from ", stock()$date[1], " to ", stock()$date[nrow(stock())]), subtitle = paste0("Close price: $", round(stock()$close[nrow(stock())], 2), " ", "Close date: ", stock()$date[nrow(stock())])) + theme(legend.position ="none", axis.title.y = element_blank(), axis.title.x=element_blank(), axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1), plot.title= element_text(hjust=0.5)) + scale_y_continuous(labels = scales::label_dollar(), position = "right") + scale_x_date(date_breaks = input$dateBreaks, date_labels = "%Y-%m-%d") + coord_cartesian(ylim = c(min(stock()$close)*0.9, max(stock()$close))*1.05) + geom_line(aes(x = date, y = movAvg)) # new code to plot the MA }) output$candlePlot <- renderPlot({ cp() }, res = 96) output$data <- renderTable({ brushedPoints(stock(), input$plot_brush) }) } # Run the application shinyApp(ui = ui, server = server)
@kateekhator9941
@kateekhator9941 2 жыл бұрын
Thanks for sharing this information on percentage change, please i cant locate the percentage change function in my rstudio. Do i need to load a specfic package to use the function?
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you for watching. Please note that the videos starting with "Write Functions in R" are about coding from scratch. This means that per_change() is a function that we write and it doesn't exist in R. PS I think you can find a function for percentage change in the TTR package.
@kateekhator578
@kateekhator578 2 жыл бұрын
Could not find per_change in TTR package, I am not clear how you write per_change in R. Could you explain further how a function that do not exist in R is written? Thanks.
@ahmadalarfaj8940
@ahmadalarfaj8940 2 жыл бұрын
Thank you very much, I appreciate your effort. And this is the code, for more convenient sudoku<-matrix(c(NA,NA,NA,NA, 2, 1,NA,NA, 3, NA,NA, 6, 5,NA,NA,NA,NA, 8, NA,NA, 4, 7,NA,NA,NA,NA, 6, NA, 5,NA,NA, 8,NA,NA,NA,NA, NA, 7,NA,NA,NA,NA,NA, 9,NA, NA,NA,NA,NA, 6,NA,NA, 2,NA, 1,NA,NA,NA,NA, 5, 4,NA,NA, 8,NA,NA,NA,NA, 2, 5,NA,NA, 3,NA,NA, 9, 4,NA,NA,NA,NA), byrow=TRUE,nrow=9) isInRow <- function(X, row, num) { if (any(X[row, ] == num, na.rm = TRUE)){ return(TRUE) } return(FALSE) } isInRow(sudoku,1,7) inInCol <- function(X, col, num) { if (any(X[, col] == num, na.rm = TRUE)){ return(TRUE) } return(FALSE) } inInCol(sudoku,1,7) isInBox <- function(X, row, col, num){ box_row <- (( row - 1)%/%3)*3 box_col <- (((col - 1)%/%3)*3) + 1:3 if(any(X[(box_row + 1), box_col] == num, na.rm =TRUE) || any(X[(box_row + 2), box_col] == num, na.rm =TRUE) || any(X[(box_row + 3), box_col] == num, na.rm =TRUE)) { return(TRUE) } return(FALSE) } isInBox1 <- function(X, row, col, num){ box_row <- (((row - 1)%/%3)*3) + 1:3 box_col <- (((col - 1)%/%3)*3) + 1:3 if(any(X[box_row, box_col] == num, na.rm =TRUE)) { return(TRUE) } return(FALSE) } isPossible <- function(X, row, col, num){ if(isFALSE(isInRow(X, row, num)) && isFALSE(inInCol(X, col, num)) && isFALSE(isInBox(X, row, col, num))){ return(TRUE) } } possibleNumbers <- function(X, row, col){ n <- 1:9 p <- NA for (num in n){ if(isTRUE(isPossible(X, row, col, num))) p <- append(p, num) } p <- p[complete.cases(p)] return(p) } sudoku_solver <- function(X){ if(all(!is.na(X))){ return(X) } df <- which(is.na(X), arr.ind=TRUE) row = df[1, 1] col = df[1, 2] p <- possibleNumbers(X, row, col) for ( i in p ){ X[row, col] <- i sol <- sudoku_solver(X) if(!is.null(sol)){ return(sol) } } return(NULL) } sudoku_solver(sudoku)
@labtimeRP
@labtimeRP 2 жыл бұрын
Thank you for appreciating. If you like this kind of videos, next it's coming "battleship"
@rebeccakipanga478
@rebeccakipanga478 2 жыл бұрын
Very ice video. Thank you Sir.
@labtimeRP
@labtimeRP 2 жыл бұрын
Thank you for your comment. Appreciated!
@yoni4422
@yoni4422 2 жыл бұрын
The topic you raised is fantastic, but when open my R and follow your steps, I couldn't get the results. I found the way you present little bit complicated.
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you for your feedback. Which result you can't get?
@maxijuega197
@maxijuega197 2 жыл бұрын
Hello, why when you deploy the plot, and select some variables, the date in table it looks without date format.?
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, if I am not wrong it is an issue of shiny itself. However, I remembered I solved the issue in a later script. I think this series has 4 or 5 more scripts to go
@labtimeRP
@labtimeRP 2 жыл бұрын
hi, it will take a while to load the rest of the series. Basically, to solve that issue I added a new column in the data frame where I convert the date into a character. However, in the final script I completely remove the table output because I make the plot interactive with plotly so the data will be readable directly from the plot. I hope this helps
@ganeshkarthik2296
@ganeshkarthik2296 2 жыл бұрын
Nice 👍
@labtimeRP
@labtimeRP 2 жыл бұрын
Thank you!
@qulingyun3303
@qulingyun3303 2 жыл бұрын
Hello, thank you for the video. I was reproducing the codes with another column of data which has one value for each town name in Japan. However, the output has only plotted the values without the outline of the country or the borders among cities. Could you please help?
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you for watching. Can you tell me if you get the same issue if you try to map a column of random values to town names? If you did not watch yet, I would recommend watching Maps with R: Tokyo map with ggplot2 | GADM geo data || 10 kzbin.info/www/bejne/oqPVnISipa1_eLM where I show how you can work with town data
@qulingyun3303
@qulingyun3303 2 жыл бұрын
@@labtimeRP Thank you for the advice. The town worked out fine. I was wondering if it was because I missed data when mapping my values to the name of cities.
@labtimeRP
@labtimeRP 2 жыл бұрын
Yes, I think that may be the issue. Working with town data is tricky. For example, if you try to map Tokyo you will not find it in the GADM data because Tokyo is reported by its special wards. Additionally, in the case of Japan special characters in the town name such as bar accent can create problems when mapping or merging.
@qulingyun3303
@qulingyun3303 2 жыл бұрын
Totally agree and tidying up the town names is really a torture... Thank you for the kind help. Is there any way to draw the broadline? I mean, the city border, so that the data can start from 0 and the place is colored white?
@labtimeRP
@labtimeRP 2 жыл бұрын
To trace a border line you can add color and size in the geom_polygon(). You may refer to the answer to one of the comments in this video Maps with R: choropleth map with ggplot2 | map of China, Japan and South Korea || 01 kzbin.info/www/bejne/gICaf2BqhZelaq8 For the city name, you can create a vector of ordered unique values and assign an id to each of them. Then you assign the same id to the unique entries in the other dataset. And then merge the two datasets by the id. Naturally I assume you have the same cities in the two datasets. It should not matter if they are written differently - i.e. some use special characters - when you sort them in alphabetical order. For Tokyo you may assign the same id to its wards. In this case when you merge all the Tokyo wards will be mapped to the Tokyo population. I hope this can be useful
@yashkumarsaywan500
@yashkumarsaywan500 2 жыл бұрын
found really helpful, thanks
@labtimeRP
@labtimeRP 2 жыл бұрын
I am glad you found it helpful 👍
@oljatalokha4334
@oljatalokha4334 2 жыл бұрын
The video is interesting, but this is not a conflict. This is a real deadly war. We should call a spade a spade
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you for watching. It seems to me that the KZbin algorithm is pushing the video in these days. However, please note that when the video was made most of the analysts I read about did not expect it would last so long and the word "conflict" was also used. However, I am not an expert of the region or the Russia-Ukraine relations. I updated the title accordingly.
@solomiiasd
@solomiiasd 2 жыл бұрын
IT IS WAR NOT CONFLICT
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you for watching. It seems to me that the KZbin algorithm is pushing the video in these days. However, please note that when the video was made most of the analysts I read about did not expect it would last so long and the word "conflict" was also used. However, I am not an expert of the region or the Russia-Ukraine relations. I updated the title accordingly.
@MegaMaster764
@MegaMaster764 2 жыл бұрын
Hi, great video. When i was copying you i used two neighbouring countries with very similar population sizes. Is there a way to trace the borders of the countries?
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you! If I understand correctly you want to add a border line between the countries, correct? If this is what you want you can add color and size. For example, in the choropleth map in the video replace this code: geom_polygon(data = df, aes(x = long, y = lat, group = group, fill = pop), colour = "red", size = 1) I hope this is helpful
@MegaMaster764
@MegaMaster764 2 жыл бұрын
@@labtimeRP Hi, thank you. Yes was exactly what i wanted to do.
@labtimeRP
@labtimeRP 2 жыл бұрын
@@MegaMaster764 perfect! 👍
@labtimeRP
@labtimeRP 2 жыл бұрын
The time stamp of the video: 00:01:30 How to write and label equations 00:05:50 Greek letters 00:07:10 Parenthesis 00:09:00 Fractions 00:11:40 Square root 00:12:35 Subscript 00:13:50 Superscript 00:14:15 System of equations 00:16:00 Summation 00:17:00 Limit 00:17:50 Derivatives 00:20:10 Integrals 00:20:40 Matrix 00:23:20 Equality and inequality 00:24:05 Set and subset 00:24:45 Math spaces 00:25:45 Mathematical fonts 00:26:45 Optimization
@carlocoppo3926
@carlocoppo3926 2 жыл бұрын
Very interesting!!
@labtimeRP
@labtimeRP 2 жыл бұрын
Thank you for your comment! I am glad you found it interesting
@StefanoVerugi
@StefanoVerugi 2 жыл бұрын
useful stuff, thanks a lot for posting
@labtimeRP
@labtimeRP 2 жыл бұрын
Thank you for your comment. Very much appreciated!
@zouheirhamimaz3729
@zouheirhamimaz3729 2 жыл бұрын
Thank you very much for sharing. extremely handy !
@labtimeRP
@labtimeRP 2 жыл бұрын
Thank you for watching! I am glad you find it useful
@drahmsha
@drahmsha 2 жыл бұрын
Could you share the code file please? thanks in advance
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you for watching. You can find the code in the description.
@callingwind5071
@callingwind5071 2 жыл бұрын
Possible to get the code in txt?
@labtimeRP
@labtimeRP 2 жыл бұрын
Sure, I will put in the description in the next days
@callingwind5071
@callingwind5071 2 жыл бұрын
Hello, thank you for your video. Could you do a map like this but for a region and its localities?
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi Adrien, thank you for watching. Perhaps the following videos answer your question: Maps with R: Tokyo map with ggplot2 | GADM geo data || 10 kzbin.info/www/bejne/oqPVnISipa1_eLM Maps with R: map of the Russia-Ukraine conflict with leaflet | GADM | video 2 || 13 kzbin.info/www/bejne/p52spXiljNOripI
@callingwind5071
@callingwind5071 2 жыл бұрын
@@labtimeRP thank you for the prompt answer. I will check that :).
@ammichalzeszen
@ammichalzeszen 2 жыл бұрын
Hi there. I'm using the record_path and meta method to extract data from an API with multiple nested values, but I can't figure out how to extract values from 1 level, go back and retrieve more data from another level.
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, thank you for watching. Which error do you get? Did you try also method 1?
@labtimeRP
@labtimeRP 2 жыл бұрын
Hi, I made a video to answer your question. I hope it is useful. kzbin.info/www/bejne/iXqkpq2od5iCibc
@labtimeRP
@labtimeRP 2 жыл бұрын
For details about the code, you may refer to Maps with R: add images and lines to a leaflet map | Italy's path to 2006 World Cup in Germany || 03 kzbin.info/www/bejne/enmolo2sic-Dmtk Maps with R: choropleth map with leaflet | map of Australia || 04 kzbin.info/www/bejne/d5uph4Ruqs-in6c Maps with R: choropleth map with leaflet | map of the European Union || 05 kzbin.info/www/bejne/b5aVmZefedmeZ7M
@labtimeRP
@labtimeRP 2 жыл бұрын
For details about the code, you may refer to Maps with R: add images and lines to a leaflet map | Italy's path to 2006 World Cup in Germany || 03 kzbin.info/www/bejne/enmolo2sic-Dmtk Maps with R: choropleth map with leaflet | map of Australia || 04 kzbin.info/www/bejne/d5uph4Ruqs-in6c Maps with R: choropleth map with leaflet | map of the European Union || 05 kzbin.info/www/bejne/b5aVmZefedmeZ7M