My input table has two columns like this:
x y
1 187
2 235
3 857
3 253
2 955
1 267
I want to make a boxplot of the y values for each individual x value. The x values are limited to 1, 2, 3.
Here is my R code:
data=read.table("input.txt")
arr=array(dim=3)
for (i in 1:3)
{
arr[i]=data[data.x==i,"y"] // This line raises warnings.
}
boxplot(arr)
How to correct my code?