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

Ista Zahn istazahn at gmail.com
Sat Jun 29 15:08:22 CEST 2013


Why don't you try it and see?

data.frame(x=1:5, y=letters[1:5])
expand.grid(x=1:5, y=letters[1:5])

?data.frame
?expand.grid

On Fri, Jun 28, 2013 at 8:30 AM, Zhaoran Zhou <zhaoran1124 at gmail.com> wrote:
> 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.



More information about the R-help mailing list