Gabriel
Gabriel

Reputation: 33

expression() command in R with semicolons

In the output of the following code,

curve((1+exp(-1*x))^-1,
    xlim=c(-10,10),ylim=c(0,1),
    main="Logistic function",xlab=expression ("x"[t-d]),
    ylab=expression ("G"("x"[t-d],gamma,c)))

In the y-axis label, how to place a semi-colon in between immediately before the gamma instead of a comma?

Upvotes: 2

Views: 380

Answers (1)

MrFlick
MrFlick

Reputation: 206382

In this case you just need to think of the semicolon as text rather than a special character you can do

ylab=expression ("G"("x"[t-d]~";"~gamma,c))

or you can use * rather than ~ if you want less space.

Upvotes: 2

Related Questions