Update app.R
Browse files
app.R
CHANGED
|
@@ -16,7 +16,13 @@ download_private_csv <- function(repo_id, filename) {
|
|
| 16 |
if (status_code(response) == 200) {
|
| 17 |
content <- content(response, "text")
|
| 18 |
con <- textConnection(content)
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
close(con)
|
| 21 |
return(data)
|
| 22 |
} else {
|
|
@@ -24,7 +30,6 @@ download_private_csv <- function(repo_id, filename) {
|
|
| 24 |
}
|
| 25 |
}
|
| 26 |
|
| 27 |
-
# Usage
|
| 28 |
Beam <- download_private_csv("TimStats/CollegePriv", "Beam.csv")
|
| 29 |
|
| 30 |
test <- Beam %>%
|
|
|
|
| 16 |
if (status_code(response) == 200) {
|
| 17 |
content <- content(response, "text")
|
| 18 |
con <- textConnection(content)
|
| 19 |
+
|
| 20 |
+
# Try different read options
|
| 21 |
+
data <- read.csv(con,
|
| 22 |
+
header = TRUE,
|
| 23 |
+
check.names = FALSE, # This prevents R from modifying column names
|
| 24 |
+
fileEncoding = "UTF-8",
|
| 25 |
+
stringsAsFactors = FALSE)
|
| 26 |
close(con)
|
| 27 |
return(data)
|
| 28 |
} else {
|
|
|
|
| 30 |
}
|
| 31 |
}
|
| 32 |
|
|
|
|
| 33 |
Beam <- download_private_csv("TimStats/CollegePriv", "Beam.csv")
|
| 34 |
|
| 35 |
test <- Beam %>%
|