2016-11-20 1 views
-2

-Code, wo versucht g + labs(y=expression(N_{s})) mit dem folgenden Fehler anzuwenden, den Sinn nichtWarum funktioniert dieser Rgplot-Index nicht?

g <- ggplot(datm, aes(variable, value, fill=gender)) + geom_bar(stat="identity", position = position_dodge()) + facet_grid(male.Nij ~ group) + xlab("Association type") + ggtitle("View") 
#http://stackoverflow.com/a/17335258/54964 
g + labs(y=expression(N_{s})) 

I

Error: unexpected '{' in "g + labs(y=expression(N_{" 
Execution halted 

R erhalten machen: 3.3.2 updates
OS: Debian 8.5

Antwort

1

es es nicht {}

# if you want to use sbuscript, use [] 
p + labs(y=expression(N[s])) 
# or as is 
p + labs(y=expression(N_~'{s}')) 
Verwandte Themen