[R] what is the difference between the function "expand.grid" and "data.frame"?

John Kane jrkrideau at inbox.com
Sat Jun 29 15:10:19 CEST 2013

Just have a look at the two help pages ?expand.grid and ?data.frame.

R experts will wince but I believe that you can think of a data.frame as one type of R object and expand.grid as one very specialized way to create a data.frame. 

I guess you can say one is an object and the other is a function to create such an object.

John Kane
Kingston ON Canada

> -----Original Message-----
> From: zhaoran1124 at gmail.com
> Sent: Fri, 28 Jun 2013 15:30:44 +0300
> To: r-help at r-project.org
> Subject: [R] what is the difference between the function "expand.grid"
> and "data.frame"?
> Hello everyone,
> i found that both of the 2 functions ("expand.grid" and "data.frame") can
> be used to produce data frame. are there any difference between them?
> thanks for your help!
> zhaoran
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org 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.

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

More information about the R-help mailing list