This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I arrange data using R following these conditions?

I am a new user programming. When I loaded my data into the R I found …

str(g)
data.frame':    253227 obs. of  2 variables:

 $ ID             : int  7896741 7896743 7896745 7896747 7896749 7896751 7896753 7896755 7896757 7896758 ...
 $ gene_assignment: Factor w/ 85855 levels "","---","AB001736 // IGLJ3 /// AB001733 // IGLJ3 /// ENST00000390609 // IGHV3-23 /// X14584 // IGHV3-23 /// BC072419 // "| __truncated__,..: 16002 81923 16018 2 2 2335 2 2392 5497 5497 ...

Actually, in my data frame two columns, ID and gene_assignment and I opened it in excel , some ID haven’t nothing (blank in the excel) but R studio showed like this (“ “), on the other hand some ID in the excel like ---- sign, and R studio showd ‘’----‘’, rest of them have many things and in a single row contains 16 to 17 variables and there variables are separated via “// “ sign.

Now, my query is I would like to remove those ID contain blank and dot(--) sign, secondly I would like to sort out other IDs which contain 16 to 17 variable , in these case all are different variable some are in the first 4 or 2 letters are similar rest of them integers but I don’t know how can proceed.

With thanks, Gene

r

It always helps to include all the commands (in this case used to import the data). Are you using a specific R package?

0 answers

No answers yet.

Log in to answer this question.