[R] Superscripts and rounding
ehux
emily.huxter at ec.gc.ca
Thu Jul 30 23:40:32 CEST 2009
This code WORKS!!!!!!!! but i can not get it to work when i add the rest of
the sub-title. I have tried three different ways.
# WORKS
plot (
decade[['date']],
decade[['value']],
type = 'l',
col = 'lightsteelblue4',
ylab = 'Discharge [cms]',
main = sprintf('%s [%s]', stn[['metadata']][['name']],
stn[['metadata']][['id']]),
sub = sprintf('Seasonal station with natural streamflow - Lat: %s',round
(stn[['metadata']][['latitude']], digits=5)),
cex.sub = 1, font.sub = 3, col.sub = "black"
)
#does not work
plot (
decade[['date']],
decade[['value']],
type = 'l',
col = 'lightsteelblue4',
ylab = 'Discharge [cms]',
main = sprintf('%s [%s]', stn[['metadata']][['name']],
stn[['metadata']][['id']]),
sub = sprintf('Seasonal station with natural streamflow - Lat: %s',round
(stn[['metadata']][['latitude']], digits=5)),'Lon: %s
Gross Area %s\km\UB2 - Effective Area
%s\km\UB2',stn[['metadata']][['longitude']],stn[['metadata']][['grossarea']],
stn[['metadata']][['effectivearea']]),
cex.sub = 1, font.sub = 3, col.sub = "black"
)
#does not work
plot (
decade[['date']],
decade[['value']],
type = 'l',
col = 'lightsteelblue4',
ylab = 'Discharge [cms]',
main = sprintf('%s [%s]', stn[['metadata']][['name']],
stn[['metadata']][['id']]),
sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s
Gross Area %s\km\UB2 - Effective Area %s\km\UB2',round
(stn[['metadata']][['latitude']],
digits=5)),stn[['metadata']][['longitude']],stn[['metadata']][['grossarea']],
stn[['metadata']][['effectivearea']]),
cex.sub = 1, font.sub = 3, col.sub = "black"
)
#plot works but does not round number
plot (
decade[['date']],
decade[['value']],
type = 'l',
col = 'lightsteelblue4',
ylab = 'Discharge [cms]',
main = sprintf('%s [%s]', stn[['metadata']][['name']],
stn[['metadata']][['id']]),
sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s
Gross Area %s\km\UB2 - Effective Area
%s\km\UB2',round(stn[['metadata']][['latitude']],
digits=5),stn[['metadata']][['longitude']],stn[['metadata']][['grossarea']],
stn[['metadata']][['effectivearea']]),
cex.sub = 1, font.sub = 3, col.sub = "black"
)
--
View this message in context: http://www.nabble.com/Superscripts-and-rounding-tp24682319p24747802.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list