This is my code on R, and it keeps getting me the message
Error: unexpected '}' in " }"
when I try to run it. What is the problem? I checked the balance of the brackets and according to forums it should work.
n = 1
while(n < 3) {
i = 2
while (i < 17) {
data_freq = data_pourcentage %>%
filter(groupe = i & groupe = n) %>%
mutate(pourcentage = sum(freq)) %>%
mutate(pourcentage = freq / pourcentage)
data_pourcentage = left_join(
data_freq,
data_pourcentage,
by = c(
"sujet", "groupe", "identification",
"cristallisation", "valence", "freq")
)
i = i + 1
}
n = n + 1
}
&in thefiltercommand is the problem. Just withfilter(groupe = i)all works fine. Do you meanfilter(groupe= c(i,n))?whileloop with a call togroup_by.