I've seen examples of plot
function where either tilde or particular arguments were used. Following produces exactly the same plot (notice that when tilde is used x and y are swapped):
x = 1:10
y = 11:20
plot(x,y)
plot(y~x)
I've read about tilde in R but did not catch it's purpose. Only fact that I was able to grasp is that it is used in correlation/regression for some reason. Can someone clarify the tilde purpose? Is tilde needed when we can just swap arguments? Isn't tilde just syntactic sugar?