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
Milestone

Comments

@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Dec 23, 2013

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 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 hadley commented Jan 29, 2014

@hadley hadley closed this in b87c090 Feb 3, 2014
@hadley hadley added this to the v0.1.2 milestone Feb 17, 2014
@hadley hadley removed this from the v0.2 milestone 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants