I'm trying to get an Label on an arrow that says:
||x|| cos (alpha)
But I can't seem to make it work.
I can write the ||x||
without problems, and the cos (alpha) without problems, but I don't know how to get them into one statement.
Any ideas?
Here is my code:
library(plotrix)
library(shape)
xlim <- c(-2, 6)
ylim <- c(-2, 6)
plot(0, type = "n", xlim = xlim, ylim = ylim,asp=1)
Arrows(1,1,5,1)
boxed.labels(3,1,labels="||x|| cos (a)",border=NA,xpad=1,ypad=1)
Arrows(1,2,5,2)
boxed.labels(3,2,labels=expression(cos (alpha)),border=NA,xpad=1,ypad=1)