Programming with R

How-To Tutorials Tips - R Programming for Humans

GET Hackernews Front Page Results using REST API in R

Whenever we talk about Data Collection, We usually think about Web Scraping. What’s often forgotten is that a lot of websites / web apps usually offer API to access their data in the right way. This video tutorial explains how you can use httr package to use GET requests (REST API Calls) to collected data from Hacker News, a very popular website for Tech News. The objective of this post it that it can outline how to simple use httr’s GET() to start making REST API calls and also to parse the response object and extract desired data.

Automated Programmatic Website Screenshots in R with {webshot} [Video Tutorial]

In this video tutorial, We explore the R package {webshot} by Winston Chang. This package internally uses phantom js to capture screenshot of web pages / websites, Shiny Applications, RMarkdown documents. {webshot} also lets you take screenshot of a particular viewport or a section of website selected by css selector. Youtube: https://youtu.be/oQKwd1cgiq4 Please subscribe and leave a comment if you have any feedback. I’m new for this Video making so any suggestion/feedback to improve would be a great benefit!

How to do Excel VLOOKUP in R (using left_join, merge)

This tutorial helps you code Excel’s VLOOKUP (Exact Match) functionality in R using dplyr’s left_join() and Base-R’s merge(). Please let me know your feedback if this can help Excel users try out R and get confident about doing Data Analytics in R Youtube - https://www.youtube.com/watch?v=GsxlOwa4dSg Video Tutorial Code # library tidyverse for data manipulation and plot library(tidyverse) # reading input dataset co2 <- read_csv("C:/users/abdrs/Downloads/food_consumption.csv") countries <- read_csv("C:/users/abdrs/Downloads/Countries-Continents.

Easy ggplot2 Theme customization with {ggeasy}

In this post, We’ll learn about {ggeasy} an R package by Jonathan Carroll. The goal of {ggeasy} is to help R programmers make ggplot2 theme customizations with simple-easy English functions. (much easier than playing with theme()) We use dataset generated by {fakir} for this tutorial. Youtube: https://youtu.be/iAH1GJoBZmI Video Tutorial Code library(fakir) library(tidyverse) library(ggeasy) # generate dataset clients <- fakir::fake_ticket_client(100) # rotate x axis labels clients %>% count(state) %>% ggplot() + geom_col(aes(state,n)) + easy_rotate_x_labels() # color the text and increase text size clients %>% count(state) %>% ggplot() + geom_col(aes(n,state), fill = "orange") + easy_text_color("orange") + easy_text_size(25, teach = TRUE) # move legend position clients %>% count(state, source_call) %>%# View() ggplot() + geom_col(aes(n,state, fill = source_call)) + #easy_move_legend("bottom", teach = TRUE) theme(legend.