total beginner and very hopeful someone can help me(: Wrote the following code to create a statistics summary table grouped by city, but my table turned out weird looking (instead of looking like a table, it displayed the table spacers). What should I do?
load('myData.RData')
#install.packages('qwraps2')
library(qwraps2)
options(qwraps2_markup = 'markdown')
summary_statistics <-
list(
"Hobby(hours/week)" =
list(
"mean (sd)" = ~qwraps2::mean_sd(myData$hobby_hr_week, na_rm = TRUE),
"min" = ~min(myData$hobby_hr_week, na.rm = TRUE),
"max" = ~max(myData$hobby_hr_week, na.rm = TRUE)
),
"Work(hours/week)" =
list(
"mean (sd)" = ~qwraps2::mean_sd(myData$work_hr_week, na_rm = TRUE),
"min" = ~min(myData$work_hr_week, na.rm = TRUE),
"max" = ~max(myData$work_hr_week, na.rm = TRUE)
),
"Wellness" =
list(
"mean (sd)" = ~qwraps2::mean_sd(myData$wellness, na_rm = TRUE),
"min" = ~min(myData$wellness, na.rm = TRUE),
"max" = ~max(myData$wellness, na.rm = TRUE)
),
"Happiness" =
list(
"Happiness" = ~qwraps2::n_perc(myData$RU_happy)
)
)
how the table looks like:
|Summary Statistics Table for the Wellness Data Set |myData$city: Eilat (N = 25) |myData$city: jerusalem (N = 25) |myData$city: Metula (N = 25) |myData$city: TelAviv (N = 25) |
|:--------------------------------------------------|:---------------------------|:-------------------------------|:----------------------------|:-----------------------------|
|**Hobby(hours/week)** | | | | |
| mean (sd) |15.54 ± 4.49 |15.54 ± 4.49 |15.54 ± 4.49 |15.54 ± 4.49 |
| min |3.926501 |3.926501 |3.926501 |3.926501 |
| max |27.00809 |27.00809 |27.00809 |27.00809 |
|**Work(hours/week)** | | | | |
| mean (sd) |30.45 ± 19.51 |30.45 ± 19.51 |30.45 ± 19.51 |30.45 ± 19.51 |
| min |1.945099 |1.945099 |1.945099 |1.945099 |
| max |68.70944 |68.70944 |68.70944 |68.70944 |
|**Wellness** | | | | |
| mean (sd) |-56.11 ± 100.01 |-56.11 ± 100.01 |-56.11 ± 100.01 |-56.11 ± 100.01 |
| min |-259.3496 |-259.3496 |-259.3496 |-259.3496 |
| max |144.8053 |144.8053 |144.8053 |144.8053 |
|**Happiness** | | | | |
| Happiness |35 (35.00%) |35 (35.00%) |35 (35.00%) |35 (35.00%) |
So you have to actually render the Markdown to get the graphical output you wanted.
I copied the Markdown your R command spit out into a new R Markdown file.
After escaping the dollar signs ($
to \$
) due to how RStudio's knit
function works, when I knit
, I get the following table: