Skip to content

Commit d44319b

Browse files
committed
Update index.qmd file
1 parent 8d473cb commit d44319b

File tree

1 file changed

+12
-36
lines changed

1 file changed

+12
-36
lines changed

index.qmd

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,17 @@ WEBSITE_URL <- paste0("https://", GITHUB_REPOSITORY_PARTS[1], ".github.io/", GIT
4444
# qualtRics data:
4545
# you can find this with all_surveys() %>% arrange(creationDate) %>% head()
4646
47-
QUALTRICS_FULL_URL <- "https://qualtricsxmbc2c8mjrh.qualtrics.com/jfe/form"
47+
QUALTRICS_FULL_URL <- "https://cornell.yul1.qualtrics.com/jfe/form"
4848
4949
# Public Qualtrics URL for day 2
5050
51-
QUALTRICS_SURVEY <- "SV_abcklmfXPacjpB4"
51+
QUALTRICS_SURVEY <- "SV_cNkhKL69K2Ob7o2"
5252
5353
# Time when this was posted (discard anything before that)
5454
55-
QUALTRICS_STIME <- ymd_hms("2025-06-30 23:59:00")
56-
QUALTRICS_ETIME <- ymd_hms("2025-08-26 23:59:00")
55+
QUALTRICS_STIME <- ymd_hms("2025-04-30 23:59:00")
56+
QUALTRICS_ETIME <- ymd_hms("2025-05-26 23:59:00")
57+
5758
5859
if (!dir.exists(here::here("data"))) {
5960
dir.create(here::here("data"))
@@ -71,10 +72,9 @@ Here we will demonstrate how to preserve raw survey data and also how to handle
7172

7273
Please fill out this survey:
7374

74-
`r file.path(QUALTRICS_FULL_URL,QUALTRICS_SURVEY)`
75+
<`r file.path(QUALTRICS_FULL_URL,QUALTRICS_SURVEY)`>
7576

7677
### Live Results
77-
7878
```{r downloaddata,include=FALSE}
7979
# download data to local location
8080
@@ -83,36 +83,23 @@ if (Sys.getenv("QUALTRICS_API_KEY") != "") {
8383
data.raw <- fetch_survey(surveyID = QUALTRICS_SURVEY, verbose = TRUE)
8484
data <- data.raw |>
8585
filter(Status != "Survey Preview") |>
86-
filter(consent == "Yes") |>
86+
filter(Consent == "I agree that my data will be used in the manner described.") |>
8787
filter(StartDate > QUALTRICS_STIME & EndDate < QUALTRICS_ETIME) |>
8888
# renaming variables
89-
select(StartDate,EndDate,Status,Finished,RecordedDate,ResponseId,consent,age,gender,education,tabs,name_confidential,number_confidential)
89+
select(StartDate,EndDate,Status,Finished,RecordedDate,ResponseId,Consent,Preferred_topic,Degree,JEL_primary,
90+
starts_with("JEL_secondary"),starts_with("Versioning_"))
9091
} else {
9192
data <- data.frame()
9293
}
9394
9495
```
9596

96-
```{r education_table, results='asis', include=TRUE,echo=FALSE,message=FALSE}
97-
if ( nrow(data) >0 ) {
98-
data |>
99-
select(education) |>
100-
group_by(education) |>
101-
summarise(Frequency=n()) |>
102-
ungroup() |>
103-
mutate(Percent = round(Frequency/nrow(data)*100,2)) -> data.table
104-
105-
data.table |> kable()
106-
} else {
107-
cat("No data yet. Check back later.")
108-
}
109-
```
97+
```{r create_table2, results='asis', include=TRUE,echo=FALSE,message=FALSE}
11098
111-
```{r gender_table, results='asis', include=TRUE,echo=FALSE,message=FALSE}
11299
if ( nrow(data) >0 ) {
113100
data |>
114-
select(gender) |>
115-
group_by(gender) |>
101+
select(Preferred_topic) |>
102+
group_by(Preferred_topic) |>
116103
summarise(Frequency=n()) |>
117104
ungroup() |>
118105
mutate(Percent = round(Frequency/nrow(data)*100,2)) -> data.table
@@ -123,17 +110,6 @@ data.table |> kable()
123110
}
124111
```
125112

126-
127-
```{r preserve data, include=FALSE,echo=FALSE,message=FALSE}
128-
# Now save the data to a local file
129-
if (nrow(data) > 0) {
130-
write_csv(data, here::here("data", "live-survey.csv"))
131-
saveRDS(data, here::here("data", "live-survey.rds"))
132-
} else {
133-
# message("No data to save.")
134-
}
135-
```
136-
137113
## Why
138114

139115
Lorem ipso facto.

0 commit comments

Comments
 (0)