Publications by Peter Gatica
MSDS R Winter Bridge 2021 Week 1 Assignment v2
Question 1: Write a loop that calculates 12-factorial factorial.num = 1 for(i in 1:12) { print(i) factorial.num <- factorial.num * i } ## [1] 1 ## [1] 2 ## [1] 3 ## [1] 4 ## [1] 5 ## [1] 6 ## [1] 7 ## [1] 8 ## [1] 9 ## [1] 10 ## [1] 11 ## [1] 12 print(factorial.num) ## [1] 479001600 Question 2: Show how to create a numeric vector that contain...
345 sym R (652 sym/10 pcs)
CUNY MSDS - R Bridge Week 3 Assignment
library(dplyr) library(plyr) Extract Student Math Class data file.name = "/Users/Audiorunner13/CUNY MSDS Course Work/R Programming Bridge/Data/student_mat.csv" student_math <- read.csv(file=file.name, header = TRUE, sep = ",") head(student_math, 10) Run Summary on the Students’ Math file summary(student_math) student school ...
17968 sym R (15819 sym/58 pcs) 8 img
MSDS R Winter Bridge 2021 Week 2 Assignment
library(plyr) filename <- "/Users/Audiorunner13/CUNY MSDS Course Work/R Programming Bridge/Data/Affairs.csv" affairs <- read.csv(file=filename, header = TRUE, sep = ",") head(affairs, 10) typeof(affairs) ## [1] "list" class(affairs) ## [1] "data.frame" Use the summary function to gain an overview of the data set. Then display the mean and media...
1121 sym R (6352 sym/37 pcs)
Pproject 1 - Chess Tournament Ranking
Load needed libraries # Load needed libraries library(devtools) library(tidyverse) library(RCurl) library(plyr) library(knitr) Source the tournamentinfo.txt. Although I could not figure out how to process this messy file, after so many hours trying I decided to run a few sed commandrs like sed -e ‘s/\r$//’, which get rid of carriage returns. ...
734 sym R (5315 sym/12 pcs)
DATA606 Statistics and Probability
The Hot Hand Basketball players who make several baskets in succession are described as having a hot hand. Fans and players have long believed in the hot hand phenomenon, which refutes the assumption that each shot is independent of the next. However, a 1985 paper by Gilovich, Vallone, and Tversky collected evidence that contradicted this belief ...
11883 sym R (5076 sym/31 pcs) 3 img
DATA607 Data Acquisition and Management
# Load needed libraries library(tidyverse) library(RCurl) library(knitr) library(stringr) 1. Using the 173 majors listed in fivethirtyeight.com’s College Majors dataset [https://fivethirtyeight.com/features/the-economic-guide-to-picking-a-college-major/], provide code that identifies the majors that contain either “DATA” or “STATISTICS�...
974 sym R (1986 sym/22 pcs)
Danger of Sitting in Foul Territoy
The Danger of Sitting in Foul Ball Territory Introduction In the last few years there has been an increase in injuries at major league baseball games due to foul balls hitting spectators and causing serious injuries including death. Many children and senior adults who cannot protect themselves have suffered near fatal injuries. This is not surpr...
4155 sym R (7853 sym/22 pcs) 5 img
Intro to Data
options(tidyverse.quiet = TRUE) library(tidyverse) library(openintro) names(nycflights) ## [1] "year" "month" "day" "dep_time" "dep_delay" "arr_time" ## [7] "arr_delay" "carrier" "tailnum" "flight" "origin" "dest" ## [13] "air_time" "distance" "hour" "minute" Exercise 1 Import source data nycflights. Exam...
3762 sym R (2442 sym/24 pcs) 8 img
DATA607 Data Acquisition and Management
library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ── ## ✓ ggplot2 3.3.3 ✓ purrr 0.3.4 ## ✓ tibble 3.0.6 ✓ dplyr 1.0.2 ## ✓ tidyr 1.1.2 ✓ stringr 1.4.0 ## ✓ readr 1.4.0 ✓ f...
4324 sym R (4771 sym/42 pcs) 1 img
DATA607 Data Acquisition and Management
library(devtools) ## Loading required package: usethis library(RCurl) library(plyr) library(ggplot2) library(httr) library(jsonlite) Preparing Data: Choose one of the New York Times APIs. I chose the Movie Reviews API Request API key. Construct an interface in R to read in the JSON data that will run 3 times so that I can get 60 entries for my ...
1086 sym R (3294 sym/8 pcs)