Skip to content

Instantly share code, notes, and snippets.

@earino
Created November 18, 2014 01:36
Show Gist options
  • Save earino/e7417ee21cd589eda17e to your computer and use it in GitHub Desktop.
Save earino/e7417ee21cd589eda17e to your computer and use it in GitHub Desktop.
is this not the same thing? I didn't understand your comment
> iris %>% filter(Species == "setosa") %>% .[,"Species"] %>% str()
Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
> iris %>% filter(Species == "setosa") %>% `[[`("Species") %>% str()
Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
> iris %>% filter(Species == "setosa") %>% .[,"Species"] %>% class()
[1] "factor"
> iris %>% filter(Species == "setosa") %>% `[[`("Species") %>% class()
[1] "factor"
@earino
Copy link
Author

earino commented Nov 18, 2014

so is .[,"Species"] != [[("Species") ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment