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

Last observation carried forward #43

Closed
hadley opened this issue Sep 11, 2017 · 5 comments
Closed

Last observation carried forward #43

hadley opened this issue Sep 11, 2017 · 5 comments
Labels

Comments

@hadley
Copy link
Member

hadley commented Sep 11, 2017

It would be handy to provide a helper class that only produced a value when it changed

ie.

x <- c("a", "a", "a", "b", "b")
format(locf(x))
#> a . . b .
@krlmlr
Copy link
Member

krlmlr commented Sep 12, 2017

How do we decide when to use this formatting?

@hadley
Copy link
Member Author

hadley commented Sep 12, 2017

We don't - we just provide a helper class that allows the user to opt-in. I imagine we might have quite a few of these.

@hadley hadley added the helper label Sep 15, 2017
@huftis
Copy link

huftis commented Feb 13, 2018

I like the suggestion, but this is (more or less) the opposite of ’last observation carried forward’. May I propose that the function is named something with ‘ditto’, e.g. style_ditto()?

The correct character to use is the ditto mark (〃), at least in vertical displays. It’s U+3003 in Unicode, available in R as "\U3003". (Of course, the normal ASCII quotation mark " can be used as a poor man’s substitute for the real ditto mark if necessary.)

@hadley
Copy link
Member Author

hadley commented Jun 1, 2020

Now think this is out of scope for pillar; pillar should be mostly focussed on multi-column displays.

@hadley hadley closed this as completed Jun 1, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2021

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants