---
title: "R Packages"
author: "PPOL 670"
date: "04/19/2023"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, eval = F)
```

## `googlesheets4`
```{r}
install.packages('googlesheets4')
library(googlesheets4)

#Authenticate
gs4_auth()

#Read
example_ss_id <- '1XTMcmuu0agQVC7IDN8UQvw1KfDPI_MMuY9vmFCyoOTg'
example <- read_sheet(ss = example_ss_id, 
           sheet = 1)

#Write
cc_tweets <- read.csv('https://github.com/apodkul/ppol670_01/raw/main/Data/Climate_tweets.csv')

write_sheet(ss = example_ss_id, 
            data = cc_tweets,
            sheet = 'ClimateTweets')

```

## `plotly`
```{r}
install.packages('plotly')
library(plotly)
library(ggplot2)

admit <- read.csv('https://github.com/apodkul/ppol670_01/raw/main/Data/Admissions_missing.csv')

ggplot(admit, aes(x = GRE.Score, y = Chance.of.Admit)) + 
  geom_point()

p1 <- ggplot(admit, aes(x = GRE.Score, y = Chance.of.Admit)) + 
  geom_point() 

ggplotly(p1)

p2 <- ggplot(admit, aes(x = GRE.Score, 
                        y = Chance.of.Admit, 
                        text = paste0("SOP: ", SOP, '\n',
                                      "CGPA: ", CGPA))) + 
  geom_point() 

ggplotly(p2, tooltip = 'text')
  
```

## `esquisse`

## `datapasta`

## `cronR`
```{r}
install.packages('cronR')
library(cronR)

cron_ls()

cron_add(...)
```

## `inspectdf`
```{r}
install.packages('inspectdf')
library(inspectdf)

admit %>% 
  inspect_na()

admit %>% 
  inspect_num()
```

## Installing via `devtools`
```{r}
install.packages('devtools')
library(devtools)
#https://github.com/hadley/emo

install_github('hadley/emo')
emojifont::emoji('eyes')
```

