Off topic:Applying a task to several files in R
1
0
Entering edit mode
11.4 years ago
viniciushs88 ▴ 50

I would to apply a loop in R to process several files, one file per time. The files have exactly the same pattern, just the string "...split1..." is a crescent number to my files. Then a have files like "...split1...", "...split2..." ... "...split777...". I want output files like in the same logic, in the example: "newsplit1.txt", "newsplit2.txt" ... "newsplit777.txt".

all <- read.table("nsamplescluster.split1.adjusted", header=TRUE, sep=";") all <- all[, -grep("GType", colnames(all))] write.table(all, "newsplit1.txt", sep=";")

Cheers!

R Loop sapply lapply • 4.3k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 6622 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6