Re: [R] sort list

2012-03-14 Thread sybil kennelly
O yea sure. So for example: grid <- read.table("table") ( i havent printed the output, as the table is 20,000 rows X 60 columns) point_of_interest <- c("row1", "row2") therefore all the other points in plot(table) are labelled green, but these two are labelled red. But at the minute, becaus

Re: [R] sort list

2012-03-14 Thread R. Michael Weylandt
Errr...I'm still not sure how plot(table) gives you read and green points, but it sounds like the easiest thing to do would be to use the points() function to come back in and put new green points over the red ones. E.g. plot(runif(5000), runif(5000)) points(c(0.5, 0.25), c(0.5, 0.75), col = 2, pc

Re: [R] sort list

2012-03-14 Thread R. Michael Weylandt
What sort of plot are you using? I'm not really clear on what your data as a whole look like: if you use dput() you can create a representation and we can work from there. In addition to the resources Josh recommended, the following sites can direct you to all sorts of graphical goodies, all of wh

Re: [R] sort list

2012-03-14 Thread sybil kennelly
I appreciate the reading Thank you. May i ask one final question. If i have: matrix: > var1var2 var3 > cell1x x x > cell2x x x > cell3x x x > > cell4 > > . > . > . > . > cell100 and: vector1 <- c("cell1, "cell5",cell19", "cell

Re: [R] sort list

2012-03-13 Thread sybil kennelly
Thanks Josh. I'm quite new, just wondering re:factor levels? In this example (shamelessly stolen from the internet): *schtyp* [1] 0 0 1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 0 *schtyp.f <- factor(schtyp, labels = c("private", "public")) schtyp.f* [1] private private public private private private p

Re: [R] sort list

2012-03-13 Thread Joshua Wiley
On Tue, Mar 13, 2012 at 5:15 AM, sybil kennelly wrote: > Thanks Josh. I'm quite new, just wondering re:factor levels? > > In this example (shamelessly stolen from the internet): > > schtyp > > [1] 0 0 1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 0 > > schtyp.f <- factor(schtyp, labels = c("private", "public"

Re: [R] sort list

2012-03-13 Thread Joshua Wiley
Hi Sybil, You cannot turn a list into a factor. You could do: cell_data <-c('cell1','cell2') factor_list <- factor(cell_data) or if you already have a list, unlist() or as.vector() may convert it into a vector that you can then convert to a factor. Cheers, Josh On Tue, Mar 13, 2012 at 4:29 A

[R] sort list

2012-03-13 Thread sybil kennelly
Hello can anyone help please? i read two words "cell1", "cell2" into a list. I want to turn this list into a factor. > cell_data <-list(c('cell1','cell2')) > cell_data [[1]] [1] "cell1" "cell2" > factor_list <- factor(cell_data) Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have