[R] Replacing strings to numbers

2013-07-02 Thread Jeremy Ng
Hi guys, I was wondering if any one is able to help me on a problem that I was stuck with for a long time. It involves the replacement of character strings with numbers. The character string can take on only 3 possible values, for instance: AA AT TT I would want R to replace AT with 0. Between

[R] Loading an .RData file and assigning the loaded objects within a loop

2013-06-01 Thread Jeremy Ng
Hi all, I tried to look this up online, but am still feeling a little stuck. I have a bunch of Rdata files in side my directory, and I would like to load all of them in a loop. Each time the next is read in, it would over-write the previously read in object because they will be assigned the same

[R] Help with manipulation of matrix object

2012-12-06 Thread Jeremy Ng
Hi list, I have a problem which I was stuck on for a while, and after many days still cannot find a solution to. I have a matrix, measuring m X n. An example matrix will be this: dput(sample) structure(c(2315101, 2315102, 2315103, 2315104, 2315105, 2315107, 2315108, 2315110, 2315112, 2315114,

[R] Searching up a list of values

2012-10-27 Thread Jeremy Ng
Dear list, Sorry if this is a really simple question to ask, but I have been stuck at this for some time and have no luck so far. I have 2 data files- a file containing IDs which I am interested in (maybe about 20 of them)- lets call this file A, and another file containing all the IDs (which is