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

lead/lag don't preserve factors #166

Closed
romainfrancois opened this issue Dec 23, 2013 · 2 comments
Closed

lead/lag don't preserve factors #166

romainfrancois opened this issue Dec 23, 2013 · 2 comments
Assignees
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@romainfrancois
Copy link
Member

Found this behavior while tackling #133

> f <- factor(c("a", "b", "a") )
> f
[1] a b a
Levels: a b
> lead(f, 1)
[1]  2  1 NA
> lag(f,1)
[1] NA  1  2

Is this intended ?

@ghost ghost assigned hadley Dec 23, 2013
@hadley
Copy link
Member

hadley commented Dec 26, 2013

Ooops, definitely not. I really to get in the habit of checking with factors, dates and times.

@hadley
Copy link
Member

hadley commented Jan 29, 2014

@hadley hadley closed this as completed in b87c090 Feb 3, 2014
@hadley hadley modified the milestones: v0.1.2, v0.2 Feb 17, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants