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

rowwise fails to process factors #886

Closed
holgerbrandl opened this issue Jan 13, 2015 · 0 comments
Closed

rowwise fails to process factors #886

holgerbrandl opened this issue Jan 13, 2015 · 0 comments
Assignees
Milestone

Comments

@holgerbrandl
Copy link

@holgerbrandl holgerbrandl commented Jan 13, 2015

Until now I was under the impression that I could use mutate with rowwise. However the following example seems to indicate otherwise:

data.frame(processed=c("foo", "bar")) %>% 
rowwise() %>% 
mutate(processed_trafo=paste("test", processed))

which results into

  processed processed_trafo
1       foo          test 2
2       bar          test 1

It seems that dplyr is not able to pick up the factor levels.

The example illustrates just the point but does not actually rely on the row-wise grouping. However imagine, the levels are filenames and you want to do something like

file_checksum=(system(paste("md5sum", processed), intern=T) %>% str_split_fixed(" ", 2))[1]

in mutate.

@hadley hadley added this to the 0.5 milestone May 19, 2015
@romainfrancois romainfrancois self-assigned this Aug 16, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants