Unexpected '{' in "{" (R programming) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Unexpected '{' in "{" (R programming)

idk why it is happened, this code is already closed perfectly with "}" this code: y=lynx y summary(y) outlier <- funtion(x) { n = length(x) for (k in 1 : n) { if (x[k] < quantile(x, 0.25) - 1.5 * IQR(x)) print(c("작아서 이상치", x[k])) else if (x[k] > quatile(x, 0.75) + 1.5 * IQR(x)) print(c("커서 이상치", x[k])) } } outlier(y)

16th May 2020, 5:03 PM
通流
通流 - avatar
3 Answers
+ 3
I think that function (x) = Without curly bracket
16th May 2020, 6:18 PM
Mohammed Qadir khan
Mohammed Qadir khan - avatar
+ 3
Your example has typos in "function" and "quantile". Does it change anything if you set the {} for if and else explicitly?
16th May 2020, 6:54 PM
Lisa
Lisa - avatar
+ 1
omg... i typed wrong word lol...
17th May 2020, 12:31 AM
通流
通流 - avatar