Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'frame_data() (#804) #1358

Merged
merged 2 commits into from
Aug 27, 2015
Merged

Conversation

kevinushey
Copy link
Contributor

This PR implements the proposed

frame_data(
    ~colA, ~colB,
    "a", 1,
    "b", 2
)

as a means of constructing data_frame. tibble is also included as an alias, because it's too awesome a name not to use.

@kevinushey kevinushey mentioned this pull request Aug 27, 2015
@hadley
Copy link
Member

hadley commented Aug 27, 2015

Nice! Could you please add a bullet to NEWS?

@kevinushey
Copy link
Contributor Author

Just as you posted ;)

hadley added a commit that referenced this pull request Aug 27, 2015
@hadley hadley merged commit 2e6cbaf into tidyverse:master Aug 27, 2015
@hadley
Copy link
Member

hadley commented Aug 27, 2015

Thanks!

@krlmlr
Copy link
Member

krlmlr commented Sep 1, 2015

Constructing tables with more than two rows doesn't work for me (1405946):

tbl <- dplyr::tibble(
  ~a, ~b,
  "1", 1,
  "1", 2,
  "2", 1)

tbl
## Source: local data frame [2 x 2]
## 
##       a     b
##   (chr) (chr)
## 1     1     1
## 2     2     2
tbl <- dplyr::tibble(
  ~a, ~b,
  "1", 1,
  "1", 2,
  "2", 2,
  "2", 1)

tbl
## Source: local data frame [2 x 2]
## 
##       a     b
##   (chr) (dbl)
## 1     1     1
## 2     2     2
tbl <- dplyr::tibble(
  ~a, ~b, ~Freq,
  1, 1, 5,
  1, 2, 6,
  2, 2, 7,
  2, 1, 8)

tbl
## Source: local data frame [3 x 3]
## 
##       a     b  Freq
##   (dbl) (dbl) (dbl)
## 1     1     1     5
## 2     2     6     2
## 3     7     2     1

I have a failing test case in a branch.

@kevinushey
Copy link
Contributor Author

Thanks @krlmlr -- I have a PR up that should fix this. #1377

Hopefully we can get this in before the dplyr submission...

@klmr
Copy link

klmr commented Sep 23, 2015

This needs better documentation. I’ve just read the above examples and the code and I still had no idea what this function actually does. Only once I read the fix in #1377 did it click.

krlmlr pushed a commit to krlmlr/dplyr that referenced this pull request Mar 2, 2016
@lock
Copy link

lock bot commented Jan 19, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants