how to view the top 20 lines in a long dataset

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how to view the top 20 lines in a long dataset

Louis Plough
Hi,
I am simply looking for the function that will allow you to look at the top
20 lines of a long dataset?

LP


On Mon, Nov 1, 2010 at 10:46 AM, Louis Plough <[hidden email]> wrote:

> Hi,
> I am trying to generate all possible permutations (choose 2) of a vector,
> b, for example--using 'combn' the combinations in only one direction are
> generated...
>
> > b<-c(.1,.2,.3)
> > combn(b,2)
>      [,1] [,2] [,3]
> [1,]  0.1  0.1  0.2
> [2,]  0.2  0.3  0.3
>
>                         [1,] 0.1  0.2  0.3  0.2  0.3  0.3        These
> should also be there.
>                         [2,] 0.1  0.2  0.3  0.1  0.1  0.2
>
> Is there another R function that can do this??
>
> Thanks,
> Louis
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: how to view the top 20 lines in a long dataset

Erik Iverson-3
?head or just

df[1:20, ]

Louis Plough wrote:

> Hi,
> I am simply looking for the function that will allow you to look at the top
> 20 lines of a long dataset?
>
> LP
>
>
> On Mon, Nov 1, 2010 at 10:46 AM, Louis Plough <[hidden email]> wrote:
>
>> Hi,
>> I am trying to generate all possible permutations (choose 2) of a vector,
>> b, for example--using 'combn' the combinations in only one direction are
>> generated...
>>
>>> b<-c(.1,.2,.3)
>>> combn(b,2)
>>      [,1] [,2] [,3]
>> [1,]  0.1  0.1  0.2
>> [2,]  0.2  0.3  0.3
>>
>>                         [1,] 0.1  0.2  0.3  0.2  0.3  0.3        These
>> should also be there.
>>                         [2,] 0.1  0.2  0.3  0.1  0.1  0.2
>>
>> Is there another R function that can do this??
>>
>> Thanks,
>> Louis
>>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: how to view the top 20 lines in a long dataset

Søren Højsgaard
In reply to this post by Louis Plough
See ?head
Regards
Søren

________________________________________
Fra: [hidden email] [[hidden email]] P&#229; vegne af Louis Plough [[hidden email]]
Sendt: 1. november 2010 20:40
Til: [hidden email]
Emne: [R]  how to view the top 20 lines in a long dataset

Hi,
I am simply looking for the function that will allow you to look at the top
20 lines of a long dataset?

LP


On Mon, Nov 1, 2010 at 10:46 AM, Louis Plough <[hidden email]> wrote:

> Hi,
> I am trying to generate all possible permutations (choose 2) of a vector,
> b, for example--using 'combn' the combinations in only one direction are
> generated...
>
> > b<-c(.1,.2,.3)
> > combn(b,2)
>      [,1] [,2] [,3]
> [1,]  0.1  0.1  0.2
> [2,]  0.2  0.3  0.3
>
>                         [1,] 0.1  0.2  0.3  0.2  0.3  0.3        These
> should also be there.
>                         [2,] 0.1  0.2  0.3  0.1  0.1  0.2
>
> Is there another R function that can do this??
>
> Thanks,
> Louis
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: how to view the top 20 lines in a long dataset

Felipe Carrillo
In reply to this post by Louis Plough
is this what you want?

head(yourdataset,20)
 
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA



----- Original Message ----

> From: Louis Plough <[hidden email]>
> To: [hidden email]
> Sent: Mon, November 1, 2010 12:40:19 PM
> Subject: [R] how to view the top 20 lines in a long dataset
>
> Hi,
> I am simply looking for the function that will allow you to look at the top
> 20 lines of a long dataset?
>
> LP
>
>
> On Mon, Nov 1, 2010 at 10:46 AM, Louis Plough <[hidden email]> wrote:
>
> > Hi,
> > I am trying to generate all possible permutations (choose 2) of a vector,
> > b, for example--using 'combn' the combinations in only one direction are
> > generated...
> >
> > > b<-c(.1,.2,.3)
> > > combn(b,2)
> >      [,1] [,2] [,3]
> > [1,]  0.1  0.1  0.2
> > [2,]  0.2  0.3  0.3
> >
> >                        [1,] 0.1  0.2  0.3  0.2  0.3  0.3        These
> > should also be there.
> >                        [2,] 0.1  0.2  0.3  0.1  0.1  0.2
> >
> > Is there another R function that can do this??
> >
> > Thanks,
> > Louis
> >
>
>     [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: how to view the top 20 lines in a long dataset

Gabor Grothendieck
In reply to this post by Louis Plough
On Mon, Nov 1, 2010 at 3:40 PM, Louis Plough <[hidden email]> wrote:
> Hi,
> I am simply looking for the function that will allow you to look at the top
> 20 lines of a long dataset?
>
> LP

Try this:

head(iris)
head(iris, 20)
View(iris)


--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.