+ 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 RĂ©ponses
+ 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