[R] prompts and running means

RagingJim nowa0021 at flinders.edu.au
Wed Feb 10 06:12:08 CET 2010


G'day, I am new user to R, and have been thrown in the deep end with a
something my company want me to write.

my code is as follows:

kenttemp=read.csv("mnowak.11.1.csv")
rows=nrow(kenttemp)-5
kent=kenttemp[1:rows,]              #have to remove the last 5 lines of the
graph as they interfere with rest of data
max(kent[,16],na.rm=TRUE)->ymax
ymax=ymax+200				#This is to get vertical scale to fit more accurately
Ann=kent$Ann
kent=as.matrix(kent)
barplot(Ann,main="Annual Monthly Rainfail Data", xlab="Year",ylab="Rainfall
(mm)",ylim=c(0,ymax),col="blue",space=0,names.arg=c(kent[,2]),
cex.names=0.8)


All the code works fine, and does as I want it to, however I need to create
2 things.

Firstly, I need to somehow make it so that when the script is run (I realise
that there are no functions or anything yet, but that is still beyond my 2
day old knowledge of this program, and that will come as soon as I figure it
out), it will ask the user for the name of the csv file it wants to open,
and then prompt for what the user wants to save it as.

Secondly, I need to create a running mean on the data. The data is to be
rainfaill or temp over an extended period, which will vary depending on the
files used. The data will generally range over a >30 year period, and I need
to create an 11 year running mean.

If anyone is able to at least point me in the right direction so I know
-what- to look for at least, since I am blindly fumbling my way through.

Cheers.
-- 
View this message in context: http://n4.nabble.com/prompts-and-running-means-tp1475403p1475403.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list