Skip to content
Prev 301362 / 398506 Next

Variables in a Tabular form. easily saved in a txt file

It is really not clear what you want without some idea of what the variables and data look like. 

However if the data is in a couple of vectors you could try something like this
postal  <-  c(2134, 54, 12)
superb  <-  c(2,5,54433)
cities  <-  c("City1", "City2", "City3")
hds  <-  c("Postal.Code", "Superb")

mat  <- matrix( c(postal, superb), nrow=3)
colnames(mat)  <-  hds
rownames(mat)  <-  cities
mat

dat1  <-  data.frame(cities, postal, superb)
names(dat1)  <-  c("city", "postal.code", superb)
dat1


Both of these can be save to a text file using 
?write.table 


John Kane
Kingston ON Canada
____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!