[R] Creating list with increasing string lengths

2015-06-13 Thread Nia Gupta via R-help
Hello, I am trying to create a list where each name would have an increasing vector length. For example, I am trying to obtain something that looks like this: [[1]][1] 2 [[2]] [1] 2 4 [[3]] [1] 1 2 3 . The numbers generated would just be any random numbers. My thought was to use a fo

[R] sort by decreasing columns?

2014-12-13 Thread Nia Gupta via R-help
Hello, I have a data frame that looks like this:    a  b    c 1    2   3    8 2    3   5    9 I was wondering if it was possible to reorder the columns by decreasing values so the new data frame would look like this:    c b    a 1    8 3    2 2  

[R] Question about range of letters

2014-10-04 Thread Nia Gupta
Hello, I have a column with a bunch of letters. I would like to keep some of these letters (A,C,D,L) and turn the rest into 'X'. I have tried using ifelse with '|' in between the argument but it didn't work nor did 4 separate ifelse statements. Example, I currently have: Letters    A    B