This question asks us to access the CryptoCompare API, extract the last 100 days of BTC–USD daily OHLCV data, and find the maximum daily close price.
# Install if needed
# install.packages("jsonlite")
library(jsonlite)
# API URL for last 100 days of Bitcoin in USD
url <- "https://min-api.cryptocompare.com/data/v2/histoday?fsym=BTC&tsym=USD&limit=100"
# Read JSON data
btc_raw <- fromJSON(url)
# Extract data frame
btc_data <- btc_raw$Data$Data
# Maximum closing price
max_close <- max(btc_data$close, na.rm = TRUE)
max_close
Factors Influencing College Graduate Earnings
This project explores how college characteristics—such as tuition, graduation rate, student debt, admission rate, and school type—relate to early-career earnings after graduation.
We use the U.S. Department of Education College
Scorecard dataset.
Download from: https://collegescorecard.ed.gov/data/
library(tidyverse)
# Load dataset
college <- read_csv("Most-Recent-Cohorts-Scorecard-Elements.csv")
# Select and clean relevant columns
college_clean <- college %>%
select(INSTNM, STABBR, CONTROL, ADM_RATE, GRAD_RATE,
COSTT4_A, DEBT_MDN, MD_EARN_WNE_P6) %>%
mutate(
ADM_RATE = as.numeric(ADM_RATE),
GRAD_RATE = as.numeric(GRAD_RATE),
COSTT4_A = as.numeric(COSTT4_A),
DEBT_MDN = as.numeric(DEBT_MDN),
MD_EARN_WNE_P6 = as.numeric(MD_EARN_WNE_P6)
) %>%
filter(
!is.na(ADM_RATE),
!is.na(GRAD_RATE),
!is.na(COSTT4_A),
!is.na(DEBT_MDN),
!is.na(MD_EARN_WNE_P6)
)
# Summary stats
summary(college_clean)
# Correlation matrix
college_clean %>%
select(ADM_RATE, GRAD_RATE, COSTT4_A, DEBT_MDN, MD_EARN_WNE_P6) %>%
cor(use = "complete.obs")
library(ggplot2)
ggplot(college_clean, aes(x = COSTT4_A, y = MD_EARN_WNE_P6)) +
geom_point(alpha = 0.3) +
labs(title = "Tuition vs Graduate Earnings",
x = "Tuition Cost (Annual)",
y = "Median Earnings")