or even:
head(read.table("xy.dat", header = TRUE), -2)
On Jan 28, 2008 10:52 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> If you don't mind reading it in twice its just:
>
> DF <- read.table("xy.dat", header = TRUE, nrow =
> length(readLines("xy.dat")) - 3)
> tail(DF)
> # or
> DF <- read.
Hi,
What about this :
data <- read.table( pipe('head -n-2 data.txt') )
However, the aesthetics will only appeal to people having head (maybe it
needs to be a recent version as well ...).
Cheers,
Romain
Barry Rowlingson wrote:
> Henrique Dallazuanna wrote:
>
>> Perhaps:
>>
>> data <- read
If you don't mind reading it in twice its just:
DF <- read.table("xy.dat", header = TRUE, nrow =
length(readLines("xy.dat")) - 3)
tail(DF)
# or
DF <- read.table("xy.dat", header = TRUE, nrow =
length(count.fields("xy.dat")) - 3)
tail(DF)
# or
DF <- read.table("xy.dat", header = TRUE, nrow =
nrow(r
On Mon, 28 Jan 2008, mrafi wrote:
> but then the number of levels would reamain the same...!!
Please explain: the levels of factors are taken from the data which is
actually read.
>
>
> Prof Brian Ripley wrote:
>>
>> On Mon, 28 Jan 2008, Barry Rowlingson wrote:
>>
>>> Henrique Dallazuanna wrote
Ok, I agree, but I assume that her don't know the number of rows of file.
In your example:
rev2 <- function(x,n=100,m=5){
for(i in 1:n){
y=x[1:(length(x)-m)]
}
return(y)
}
is needed that open other textConnection - if use the example posted by me.
Is there other option?
On 28/01
but then the number of levels would reamain the same...!!
Prof Brian Ripley wrote:
>
> On Mon, 28 Jan 2008, Barry Rowlingson wrote:
>
>> Henrique Dallazuanna wrote:
>>> Perhaps:
>>>
>>> data <-
>>> read.table(textConnection(rev(rev(readLines('data.txt'))[-(1:2)])))
>>>
>>
>> Euurgh! Am I the
On Mon, 28 Jan 2008, Barry Rowlingson wrote:
> Henrique Dallazuanna wrote:
>> Perhaps:
>>
>> data <- read.table(textConnection(rev(rev(readLines('data.txt'))[-(1:2)])))
>>
>
> Euurgh! Am I the only one whose sense of aesthetics is enraged by
> this? To get rid of the last two items you reverse th
Henrique Dallazuanna wrote:
> Perhaps:
>
> data <- read.table(textConnection(rev(rev(readLines('data.txt'))[-(1:2)])))
>
Euurgh! Am I the only one whose sense of aesthetics is enraged by
this? To get rid of the last two items you reverse the vector, remove
the first two items, then reverse t
Perhaps:
data <- read.table(textConnection(rev(rev(readLines('data.txt'))[-(1:2)])))
will skip the last two lines '-(1:2)'
On 28/01/2008, mrafi <[EMAIL PROTECTED]> wrote:
>
> hey all
> greetings
>
> hey all am an engineering student...and am trying to learn R
> i am trying to automate reading a
hey all
greetings
hey all am an engineering student...and am trying to learn R
i am trying to automate reading a specific type of file...and perform
certain functions...but i want to omit lines in the end of the file..
there is an option for skiping the lines before begining...but how can i ask
R
10 matches
Mail list logo