Re: [R] read floats from file into array

2009-07-21 Thread leo mueller
big thanks to all, the x[[1]] worked fine! :) 2009/7/21 Duncan Murdoch : > On 21/07/2009 6:09 AM, leo mueller wrote: >> >> hi all, >> >> i have a simple question. instead of defining my measurements in a >> static way like ... >> >> x <- c(-0.475, -1.553, -0.434, -1.019, 0.395) >> >> ... i'd like

Re: [R] read floats from file into array

2009-07-21 Thread Duncan Murdoch
On 21/07/2009 6:09 AM, leo mueller wrote: hi all, i have a simple question. instead of defining my measurements in a static way like ... x <- c(-0.475, -1.553, -0.434, -1.019, 0.395) ... i'd like them to be read from a file ... x <- read.table("07a673ac0cb1f7f8fa293860566f633c/1/raw0.txt", he

Re: [R] read floats from file into array

2009-07-21 Thread Allan Engelhardt
read.table() returns a data.frame by default. Try str(x). Options: d1 <- density(x[[1]], kernel = "gaussian") or x <- scan("07a673ac0cb1f7f8fa293860566f633c/1/raw0.txt") Hope this helps Allan. On 21/07/09 11:09, leo mueller wrote: > hi all, > > i have a simple question. instead of definin

[R] read floats from file into array

2009-07-21 Thread leo mueller
hi all, i have a simple question. instead of defining my measurements in a static way like ... x <- c(-0.475, -1.553, -0.434, -1.019, 0.395) ... i'd like them to be read from a file ... x <- read.table("07a673ac0cb1f7f8fa293860566f633c/1/raw0.txt", header=FALSE) d1 <- density(x, kernel = "gauss