This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I split a file in R?

Hello

I am new to R and would like to do this if anyone can give me example, would appreciate. If I have this file :

Row1_id ,  val11, val12 , val13 
Row2_id ,  val21, val22 , val23

I need to split it to 3 files. A file for each column plus the row id and tab separated For example file 1 should be:

row1_id val11 
row2_id val21

File 3 should look like

row1_id  val13
row2_id  val23
r

Hello Tania!

We believe that this post does not fit the main topic of this site.

Not a bioinformatics question.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

Yes, I just need it to prepare my files for defseq2. So, i focused on the main problem in the pipeline, and did not mention the reason i need it for.

Use the unix command cut instead. You need to mention the reason and you are yourself responsible for 1) showing what you have tried 2) that the question is related to bioinformatics 3) what the input and output data is coming from and going to be used for.

I would recommend asking this on Stack Overflow. You'd probably get a better response there provided that you give a reproducible example of the code you've already tried

0 answers

No answers yet.

Log in to answer this question.