[R] question on aggregate

2009-05-01 Thread Altaweel, Mark R.
Hi, I am trying to sum column information in a list with 3 instances. For example: ID Traversed IDTraversed IDTraversed 1 5 1 71 8 2 8 2 11 2 7 3

[R] plotting two variables with a third used for color

2009-03-20 Thread Altaweel, Mark R.
I have a problem where I have two columns of data that I can simply plot using: plot(wV[0:15,3],wY[0:15,3]). This produces my desired plot. Now, say I have a third variable that I would like to introduce and use that variable to set different colors in the plot In this case, say I wanted val

[R] Help with functions within a list

2009-03-20 Thread Altaweel, Mark R.
esults is not as large as I would expect. Thanks again in advance. Mark -Original Message- From: baptiste auguie [mailto:ba...@exeter.ac.uk] Sent: Fri 3/20/2009 4:32 AM To: Altaweel, Mark R. Cc: r-help@r-project.org Subject: Re: [R] functions within a list Hi, you could have a look at

[R] functions within a list

2009-03-19 Thread Altaweel, Mark R.
Hi, I am trying to perform various functions on a list with a number of elements. For example. I would like to take the mean of different variable values in the entire list. As an example, say I have a list with 1000 elements and variables called Id and Tick. What I would like to do is take the

[R] Kruskal.test() on lists

2008-08-21 Thread Altaweel, Mark R.
Hi, I am trying to do a kruskal wallis test on two lists, fVisited and cSN: fVisited[[1]] [1] 0.17097623 0.30376141 0.17577266 0.14951855 0.03959753 0.08096217 0.05744888 0.02196257 cSN[[1]] [1] 0.08557303 0.36477791 0.19601252 0.12981040 0.05351320 0.10385542 0.03539577 0.03106175...

[R] Line of best

2008-08-20 Thread Altaweel, Mark R.
Hi, I have a scatter plot, with an equation that best fits the scatter plot expressed as: 1/x^.6. I know for normal linear regression lines you can use the abline() command; however, since my best fit line is not linear, how can I draw my line on the scatter plot in a similar fashion to ablin

[R] matrix question

2008-08-19 Thread Altaweel, Mark R.
Hi, I have a vector and a list, with data I would like to multiply together. So for instance I have a vector s: [[1]] [1] 44308 [[2]] [1] 4371 Also, I have a list d: [[1]] [1] 1201 6170 2036 2927 1625 1391 2074 1453 3172 3027 4691 3719 1185 320 2071 1027 1046 1186 1403 580 1382 4408

Re: [R] conditional with and operators

2008-08-19 Thread Altaweel, Mark R.
Hi, Ok that worked...im from a Java background so I guess Im used to the && rather than & Thanks! Mark -Original Message- From: Steven McKinney [mailto:[EMAIL PROTECTED] Sent: Tue 8/19/2008 3:33 PM To: Altaweel, Mark R.; r-help@r-project.org Subject: RE: [R] conditio

[R] conditional with and operators

2008-08-19 Thread Altaweel, Mark R.
Hi, I have a problem in which I am parsing data from a list. I am simply trying to return data that has several conditions being true. Here is my syntax below: d<-sapply(res,function(.df){(.df$TimesVisited[.df$Tick>912 && .df$Id>0])}) #res is the list, and I am trying to return a result tha

Re: [R] Conditional statement used in sapply()

2008-08-13 Thread Altaweel, Mark R.
Hi, Yes, that's it. I got the correct results. Thanks everyone for their help once again. This is a great help board. Mark -Original Message- From: Steven McKinney [mailto:[EMAIL PROTECTED] Sent: Wed 8/13/2008 5:29 PM To: Altaweel, Mark R.; r-help@r-project.org Subject: R

[R] Conditional statement used in sapply()

2008-08-13 Thread Altaweel, Mark R.
Hi, I have data stored in a list that I would like to aggregate and perform some basic stats. However, I would like to apply conditional statements so that not all the data are used. Basically, I want to get a specific variable, do some basic functions (such as a mean), but only get the data i

Re: [R] Parsing array data

2008-08-12 Thread Altaweel, Mark R.
Great, that works. Thank you. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tue 8/12/2008 2:49 PM To: Altaweel, Mark R. Cc: [EMAIL PROTECTED]; r-help@r-project.org Subject: RE: [R] Parsing array data Hi: you can do result<-lapply(agg, function(

Re: [R] Parsing array data

2008-08-12 Thread Altaweel, Mark R.
ginal Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tue 8/12/2008 1:05 PM To: Altaweel, Mark R. Subject: RE: [R] Parsing array data try a<-res[[1]] instead of a<-res[1]. you need to acess the dataframe and , to do that, you need to access WHAT'S IN THE FIRST COM

[R] Parsing array data

2008-08-12 Thread Altaweel, Mark R.
Hi, I read in csv files with the following code: res <- vector(mode="list",length=3) for(i in 1: length(res)) res[[i]]<-read.csv(file=paste("/Users/markaltaweel/Desktop/Output/HydroDataOutput",i,".csv",sep=""),header=T,sep=",") This allows me to load the data into an array of length 3, with the