Publications by DR VY
Nuts and bolts
What is R? R is a dialect of the S language. S language was developed by John Chambers as an internal statistical environment. Created in 1991 by Ross Ihaka and Robert Gentlemen. Announced to the public in 1993. It is free! Very active and vibrant user community. Base system runs most fundamental functions Need packages for other specific tasks...
4559 sym R (2057 sym/35 pcs)
Document
# install.packages("data.table") library(data.table) # install.packages("ggplot2") library(ggplot2) Date Values in R Dates are represented as the number of days since 1970-01-01, with negative values for earlier dates. date1 = "2008-09-15" date1 = as.Date(date1) class(date1) ## [1] "Date" date2 = as.Date("2010-06-23") Difference between dates...
926 sym R (4737 sym/28 pcs) 3 img
Document
Q1 Use getStockReturns function (given above) to extract monthly returns for companies Google (GOOG), Exxon (XOM), Bank of America (BAC), and IBM (IBM) for years 2012 through 2017. Display the first few rows using the head function ## date GOOG XOM BAC IBM ## 1: Jan 2012 NA NA ...
654 sym R (3145 sym/5 pcs) 2 img
Publish Document
In this assignment we are going to analyse the fuel consumption of vehicles.The data was extracted from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models). Variables in the data set are as follows [, 1] mpg Miles/(US) gallon [, 2] cyl Number ...
1047 sym R (783 sym/4 pcs)
Document
Install quantmod and loading Question 1 Download daily closing price data for American Airlines Group Inc (ticker = AAL) for years 2016 through 2020 using the quantmode package. Convert the data to a data.table Delete all columns except ‘date’ and ‘closing price’ and rename the columns ‘date’ and ‘price’ ## date price ...
660 sym R (474 sym/2 pcs) 2 img
Document
rm(list=ls()) library(fst) library(ggplot2) library(data.table) library(stargazer) library(lfe) library(tidycensus) library(R.matlab) library(rgdal) library(rgeos) unempins <- fread("C:/Users/dratnadiwakara2/Documents/OneDrive - Louisiana State University/Raw Data/COVID19/Unemployment Insurance.csv") fp <- fread("C:/Users/dratnadiwakar...
1748 sym R (17955 sym/34 pcs) 13 img
Document
rm(list=ls()) library(RPostgres) library(data.table) library(getPass) library(lfe) library(stargazer) library(ggplot2) library(fst) library(stringr) library(stringi) library(lubridate) library(FinCal) source("C:/Users/dratnadiwakara2/Documents/OneDrive - Louisiana State University/functions.R") freddie <- list.files(pattern="*.fst",p...
8125 sym R (33284 sym/41 pcs) 19 img
Document
library(tidycensus) census_api_key("06b232797e7854aad802d7c7d8673c337fe1b29a") acs <- get_acs(geography = "county",variables = c("B06012_002","B01001_001"),year = 2018) acs<-data.table(acs) acs[,c("NAME","moe"):=list(NULL)] acs <- dcast(acs,GEOID~variable) acs[,pctbelowpoverty:=B06012_002/B01001_001] acs[,GEOID:=as.numeric(GEOID)] zipc...
776 sym R (9537 sym/15 pcs) 10 img
Document
zipcity <- fread("C:/Users/dratnadiwakara2/Documents/OneDrive - Louisiana State University/Raw Data/Crosswalk Files/zip_code_mapping.csv") tbill3month <- fread("C:/Users/dratnadiwakara2/Documents/OneDrive - Louisiana State University/Projects/COVID19/Muni/WTB3MS.csv") tbill3month[,DATE:=as.Date(DATE)] tbill3month[,week:=cut(DATE, "week")] t...
2177 sym R (12050 sym/21 pcs) 15 img
Document
rm(list=ls()) library(RPostgres) library(data.table) library(getPass) library(lfe) library(stargazer) library(ggplot2) library(fst) library(stringr) library(stringi) library(lubridate) files = list.files(pattern="*.fst",path = "C:/Users/dratnadiwakara2/Documents/OneDrive - Louisiana State University/Raw Data/HMDA/Ultimate Panel Data/",f...
545 sym R (27695 sym/24 pcs) 1 img