Data Analysis Expressions (DAX) includes time-intelligence functions that enable you to manipulate data using time periods, including days, months, quarters, and years, and then build and compare calculations over those periods.
We`ll be using parse_date_time function of lubridate package.
Multple datetime formats can be passed under orders attribute of the above function as shown below -
library(lubridate)
dates <- c( "1/22/2020 17:00", "2020-02-02 09:43:01", "2/1/2020 11:53")
parse_date_time(dates, orders = c('%Y-%m-%d %H:%M;%S','%m/%d/%Y %H:%M', '%m/%d/%y %H:%M'))
## [1] "2020-01-22 17:00:00 UTC" "2020-02-02 09:43:01 UTC"
## [3] "2020-02-01 11:53:00 UTC"
The following chunk of code, import required libraries and request the master branch of the required git repository.
library(httr)
library(tidyverse)
req <- GET("https://api.github.com/repos/CSSEGISandData/COVID-19/git/trees/master?recursive=1")
req
## Response [https://api.github.com/repos/CSSEGISandData/COVID-19/git/trees/master?recursive=1]
## Date: 2020-04-24 08:14
## Status: 200
## Content-Type: application/json; charset=utf-8
## Size: 88.9 kB
## {
## "sha": "###############################",
## "url": "https://api.github.com/repos/CSSEGISandData/COVID-19/git/trees/65ba...
## "tree": [
## {
## "path": ".gitignore",
## "mode": "100644",
## "type": "blob",
## "sha": "##############################",
## "size": 9,
## ...