Skip to content
Back to formatted view

Raw Message

Message-ID: <57116.130.232.44.35.1140471617.squirrel@webmail2.utu.fi>
Date: 2006-02-20T21:40:17Z
From: Atte Tenkanen
Subject: How to read more than 1 table?

Question 1) I want to read many csv-tables and run the same commands for
all of them. Is there some simpler solution than this below to solve this
problem?


for (g in 1:6)
{

if (g==1){k="kt1_0057"}
if (g==2){k="kt1_0101"}
if (g==3){k="kt1_0613"}
if (g==4){k="staten"}
if (g==5){k="tenpenny"}
if (g==6){k="fiddrunk"}

TABLE=read.table(paste("/home/user/",k,".csv",sep=""),sep = ",",
na.strings=".",header=F,fill=TRUE);

print(TABLE)

}

Question 2) Is it possible to create new variables for example with the
assistance of for-loop without initialising them beforehand?