Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
WORKS!! Thank you for all your help! 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

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
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']

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
could it be that the values accessed in the database are not integers or numeric??? -- View this message in context: http://www.nabble.com/Superscripts-and-rounding-tp24682319p24747282.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
Good one!! Although i think it is stn - none the less neither works. Polwart Calum (County Durham and Darlington NHS Foundation Trust) wrote: > > Duh! did it again! the variables need str in front of them don't they!! > > sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon

Re: [R] Superscripts and rounding

2009-07-30 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Duh! did it again! the variables need str in front of them don't they!! sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s Gross Area %s km\UB2 - Effective Area %s km\UB2 ', round( str[['metadata']][['latitude']], digits=4 ), round( str[['metadata']][['longitude']], digits =

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
I'd need access to the whole data file. I tried exporting some data from the website for it but it got too complex for me! (oh right you need the HYDAT package - sorry about that) =) However, it seems to me you have two chunks of data: you got it!!! stn[flow] - which has daily flow data in

Re: [R] Superscripts and rounding

2009-07-29 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
> > library(RODBC) > library(HYDAT) > You will need to install HYDAT (the zip file) from > http://www.geog.ubc.ca/~rdmoore/Rcode.htm > > Below is my current code - which works. The [[]] is the way i am accessing > the columns from the data frame. > > thanks again for all your help > > # load HY

Re: [R] Superscripts and rounding

2009-07-29 Thread ehux
library(RODBC) library(HYDAT) You will need to install HYDAT (the zip file) from http://www.geog.ubc.ca/~rdmoore/Rcode.htm Below is my current code - which works. The [[]] is the way i am accessing the columns from the data frame. thanks again for all your help # load HYDAT data par(mfrow

Re: [R] Superscripts and rounding

2009-07-28 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
So the issue is something to do with the [['xxx']] construction of your data. Can you explain what thats' all about - as it errors all over the shop when I try using that... You've set me on a mission to find the answer! So I'd really like to recreate a little bit of your data here, and play..

Re: [R] Superscripts and rounding

2009-07-28 Thread ehux
I receive the error message below - but i agree with you it should work? In fact i don't care if it rounds it can just cut the number at 4 decimal places. Error: unexpected symbol in: " sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s Gross Area %s km\UB2 - Effective

Re: [R] Superscripts and rounding

2009-07-28 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Slightly confused because if I try: > newdata.yaxis = c(2.473, 3.123456, 3.23456, 2.67890, 1.56789) > newdata.yaxis_4 = round (newdata.yaxis, digits = 4) > newdata.yaxis [1] 2.47 3.123456 3.234560 2.678900 1.567890 > newdata.yaxis_4 [1] 2. 3.1235 3.2346 2.6789 1.5679 As you see - I ge

Re: [R] Superscripts and rounding

2009-07-28 Thread ehux
I am in Canada and it worked!! as:\some text\UB2 the round did not work. i also tried nsmall - to specify number of digits to the right to the decimal to no avail. i will keep trying and post if something does work. Polwart Calum (County Durham and Darlington NHS Foundation Trust) wrote

Re: [R] Superscripts and rounding

2009-07-28 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
I'm anything but an expert in R however if I'm labeling a graph axis with a superscript I have tended to use: > plot (x , y , xlab = expression ("label"^2)) But when you try to have more than one superscript it fails. Assuming you are in a UTF8 location (Western Europe) you could try: > plot

Re: [R] Superscripts and rounding

2009-07-28 Thread ehux
sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s Gross Area %s km^2 - Effective Area %s km^2', stn[['metadata']][['latitude']], stn[['metadata']][['longitude']],stn[['metadata']][['grossarea']], stn[['metadata']][['effectivearea']]), I tried you

Re: [R] Superscripts and rounding

2009-07-28 Thread Uwe Ligges
ehux wrote: I am new to the world of R/programming so this may be a really easy question. I thank you for your patience and help in advance I would like the characters km^2 to be displayed on the plot subtitle as km squared - two as a superscript. I would also like to have the numbers fro

[R] Superscripts and rounding

2009-07-27 Thread ehux
I am new to the world of R/programming so this may be a really easy question. I thank you for your patience and help in advance I would like the characters km^2 to be displayed on the plot subtitle as km squared - two as a superscript. I would also like to have the numbers from the data set fo