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.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
  • Re: [R] ... ehux
  • Re: [R] ... Polwart Calum (County Durham and Darlington NHS Foundation Trust)
    • Re:... ehux
    • Re:... Polwart Calum (County Durham and Darlington NHS Foundation Trust)
  • Re: [R] ... Polwart Calum (County Durham and Darlington NHS Foundation Trust)
  • Re: [R] ... Polwart Calum (County Durham and Darlington NHS Foundation Trust)

Reply via email to