expandGrid | R Documentation |
Same as expand.grid
but with stringsAsFactors =
FALSE
by default and with the values of the first argument being changed
last, not first.
expandGrid(..., stringsAsFactors = FALSE)
... |
arguments passed to |
stringsAsFactors |
passed to |
persons <- c("Peter", "Paul", "Mary")
fruits <- c("apple", "pear")
# With expand.grid() the values of the first argument change first...
(grid_1 <- expand.grid(person = persons, fruit = fruits))
#... with expandGrid() they change last.
(grid_2 <- expandGrid(person = persons, fruit = fruits))
# With expand.grid() character strings are converted to factors by default...
str(grid_1)
# ... with expandGrid() character strings are not converted by default.
# Also, there is no attribute "out.attrs" as it is set by expand.grid().
str(grid_2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.