H ello, Did you read ?data.frame and ?expand.grid.
> data.frame(x=1:2, y=1:2) x y 1 1 1 2 2 2 > expand.grid(x=1:2, y=1:2) x y 1 1 1 2 2 1 3 1 2 4 2 2 There is a small difference, isn't it? Regards, Pascal 2013/6/28 Zhaoran Zhou <zhaoran1...@gmail.com> > 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@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. > [[alternative HTML version deleted]] ______________________________________________ R-help@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.