Skip to content

Instantly share code, notes, and snippets.

@mkuhn
Created August 14, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkuhn/69bb73f98363c4fd1ff3 to your computer and use it in GitHub Desktop.
Save mkuhn/69bb73f98363c4fd1ff3 to your computer and use it in GitHub Desktop.
library(dplyr)
a <- data.frame(foo = 1:10, bar = "bar")
b <- tbl_df(a)
a[,1]
b[,1]
paste0(a[,1], "!")
paste0(b[,1], "!")
> library(dplyr)
>
> a <- data.frame(foo = 1:10, bar = "bar")
> b <- tbl_df(a)
>
> a[,1]
[1] 1 2 3 4 5 6 7 8 9 10
> b[,1]
Source: local data frame [10 x 1]
foo
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
>
> paste0(a[,1], "!")
[1] "1!" "2!" "3!" "4!" "5!" "6!" "7!" "8!" "9!" "10!"
> paste0(b[,1], "!")
[1] "1:10!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment