Hi team
My students are having trouble with data in two-way tables: Two qualitative variables, and the chi-test of independence.
The test works OK, but when they select to find a barchart, an error emerges (in English in version 1.6.23; in Japanese in 2.0.0; they are using a Mac laptop):
"<text> 1:7: Unexpected usage of ^"
or similar. (In a class now, so a bit tricky.)
I can't see any dramas: Data looks fine, variables declared correctly as qualitative; chi-square test works.
Any help appreciated! (This is for assessment too!)
P.
Barplot crash
Barplot crash
Last edited by PeteD on Thu Oct 07, 2021 2:48 am, edited 1 time in total.
Re: Barplot crash
I got a barchart working on a windows computer with made-up data.
But the students' data failed again:
Debug
Error in parse(text = elt): <text>:1:7: unexpected symbol
1: Usage of
^
eval(ev)
eval(ev)
private$.barPlot(image, theme = t$theme, ggtheme = t$ggtheme, ...)
ggplot(data = tab, aes_string(y = "Counts", x = xVarName, fill = zVarName))
ggplot.default(data = tab, aes_string(y = "Counts", x = xVarName, fill = zVarName))
aes_string(y = "Counts", x = xVarName, fill = zVarName)
lapply(mapping, function(x) {
if (is.character(x)) {
x <- parse_expr(x)
}
new_aesthetic(x, env = caller_env)
})
FUN(X[], ...)
parse_expr(x)
parse_exprs(x)
chr_parse_exprs(x)
map(x, function(elt) as.list(parse(text = elt)))
lapply(.x, .f, ...)
FUN(X[], ...)
as.list(parse(text = elt))
parse(text = elt)
But the students' data failed again:
Debug
Error in parse(text = elt): <text>:1:7: unexpected symbol
1: Usage of
^
eval(ev)
eval(ev)
private$.barPlot(image, theme = t$theme, ggtheme = t$ggtheme, ...)
ggplot(data = tab, aes_string(y = "Counts", x = xVarName, fill = zVarName))
ggplot.default(data = tab, aes_string(y = "Counts", x = xVarName, fill = zVarName))
aes_string(y = "Counts", x = xVarName, fill = zVarName)
lapply(mapping, function(x) {
if (is.character(x)) {
x <- parse_expr(x)
}
new_aesthetic(x, env = caller_env)
})
FUN(X[], ...)
parse_expr(x)
parse_exprs(x)
chr_parse_exprs(x)
map(x, function(elt) as.list(parse(text = elt)))
lapply(.x, .f, ...)
FUN(X[], ...)
as.list(parse(text = elt))
parse(text = elt)
Re: Barplot crash
And now three groups of students are encountering the same error with different data sets (2 x Mac; 1 x windows; plus the windows machine I am using).
Re: Barplot crash
hi,
i think the issue is to do with spaces in the variable name. it's a known issue, and a fix should be coming soon.
with thanks
i think the issue is to do with spaces in the variable name. it's a known issue, and a fix should be coming soon.
with thanks
Re: Barplot crash
Yep--variables without spaces in their names work OK.
Thanks.
P.
Thanks.
P.