Page 1 of 1

Barplot crash

Posted: Thu Oct 07, 2021 12:39 am
by PeteD
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.

Re: Barplot crash

Posted: Thu Oct 07, 2021 12:53 am
by PeteD
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)

Re: Barplot crash

Posted: Thu Oct 07, 2021 1:08 am
by PeteD
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

Posted: Mon Oct 11, 2021 9:14 pm
by jonathon
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

Re: Barplot crash

Posted: Mon Oct 11, 2021 10:55 pm
by PeteD
Yep--variables without spaces in their names work OK.
Thanks.
P.