Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this notation mean in an expressoin function: *~~

Tags:

r

expression

I am working through an example from Aguinis, Gottfredson, & Culpepper (2013). They have provided some R code to plot an interaction. Here is the relevant section:

#Figure 3 Panel (b) - Reduced Y Scale
ylb=5;yub=6.5
curve(0+1*x,xlb,xub,xlab='LMX',ylab='Individual Empowerment',lwd=2,type='n',
ylim=c(ylb,yub))
for(i in 1:length(Wjs)){
    B0j=gammas[1]+gammas[3]*Wjs[i]
    B1j=gammas[2]+gammas[4]*Wjs[i]
    curve(B0j+B1j*x,xlb,xub,add=T,xlab='LMX',ylab='Individual Empowerment',lwd=2,lty=i)
}

labs=c(expression(W[j]==-1*~~SD),expression(W[j]==0*~~SD),expression(W[j]==1*~~SD))

legend(xlb,6.5,legend=c("Leadership Climate",labs[1],labs[2],labs[3]),bty='n',lty=c(0:3))

Note how the expression function is used to create the legend and there is this *~~ but in the resulting graphic there appears to be nothing more than empty space.
What is it for? What does it mean?

like image 816
vanao veneri Avatar asked Nov 24 '25 14:11

vanao veneri


1 Answers

You've guessed it! A tilde adds a space in expression(). See the table in ?plotmath for more information ... from there,

‘x*y’ juxtapose x and y

and

‘x ~~ y’ put extra space between x and y

like image 121
boshek Avatar answered Nov 27 '25 10:11

boshek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!