Skip to content

Order function

6 messages · John Kane, maths123, PIKAL Petr

#
I have a set of data with 2 columns: time, size.
There are 20 sets of data. The data is looking at whether the size of a seed
affects the time it takes to germinate. 

How do I then create a numerical variable called 'order' with values 1 to 20
in order to plot a graph or order against time?



--
View this message in context: http://r.789695.n4.nabble.com/Order-function-tp4651022.html
Sent from the R help mailing list archive at Nabble.com.
#
Are you asking how to create a variable in each data set so that data set 1 has the idenfier 1 and so on? 

It's not clear from what you say if you have 20 different data sets (say data frame or file for each ) or if you have one file with the data.  

As a brute force approach in either case I'd just create a vector of appropriate length and cbind it to the data frame or whatever.  

John Kane
Kingston ON Canada
____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
#
I have one text file with all the data on there.

So 20 rows of data. And 3 columns: numbers 1-20, size, time. 

I need to create a variable called 'order' as I need to use it for something
in the next part. 

I am very confused as to how to do this.






--
View this message in context: http://r.789695.n4.nabble.com/Order-function-tp4651022p4651166.html
Sent from the R help mailing list archive at Nabble.com.
#
This is not a homework help list and it is even less a homework help list when there is no clear statement of the problem.  I'd suggest reading something about how R works -there are some very good tutorials and introductions listed on the R site, and then perhaps coming back here if you have a specific question.

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

John Kane
Kingston ON Canada
____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!
#
Hi
order <- 1:20

But order is also a function so you shall name it differently.

Regards
Petr