Skip to content

a simple question

2 messages · chin wei, Adaikalavan Ramasamy

#
hi, all. 
I am a beginner. Could you tell me how to use read.table() to read
following beams.txt file.
thanks

file content is here:

"beams" <-
structure(list(strength = c(11.14, 12.74, 13.13, 11.51, 12.38, 
12.6, 11.13, 11.7, 11.02, 11.41), SpecificGravity = c(0.499, 
0.558, 0.604, 0.441, 0.55, 0.528, 0.418, 0.48, 0.406, 0.467), 
    moisture = c(11.1, 8.9, 8.8, 8.9, 8.8, 9.9, 10.7, 10.5, 10.5, 
    10.7)), .Names = c("strength", "SpecificGravity", "moisture"
), class = "data.frame", row.names = c("1", "2", "3", "4", "5", 
"6", "7", "8", "9", "10"))
#
Try source("beams.txt") which reads and executes the commands in
beams.txt. 

It might make more sense in future to store and work with dataframes,
especially with big datasets.

Regards, Adai
On Tue, 2005-03-22 at 17:00 +0800, chin wei wrote: