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

Replace all NA with "" #131

Closed
dmenne opened this issue Nov 18, 2014 · 6 comments
Closed

Replace all NA with "" #131

dmenne opened this issue Nov 18, 2014 · 6 comments

Comments

@dmenne
Copy link

dmenne commented Nov 18, 2014

Is there a way to replace all NA with "" in pander/pandoc?

@daroczig
Copy link
Member

Can you please show a use-case for such replacement? Do you mean replacing NA values in tables to empty cells or also e.g. numeric vectors etc?

@dmenne
Copy link
Author

dmenne commented Nov 18, 2014

library(pander)
natab = data.frame(
  name=c("Dieter","daroczig",NA),
  size=c(1,NA,3),
  date=c(rep(date(),2),NA)
  )

pander(natab)

In many cases it looks better if the NA characters in the table where just empty.

@daroczig
Copy link
Member

I've just pushed some updated resulting in the following demo:

> panderOptions('missing', '')
> pander(natab)

----------------------------------------
  name    size            date          
-------- ------ ------------------------
 Dieter    1    Wed Nov 19 00:34:13 2014

daroczig        Wed Nov 19 00:34:13 2014

           3                            
----------------------------------------

Please let me know how it works.

@dmenne
Copy link
Author

dmenne commented Nov 19, 2014

Wow, perfect. Thanks a lot!

@plankter
Copy link

panderOptions('missing', '') is a very welcome addition. Could you tell please when version 0.5.2 will be available on CRAN?

@daroczig
Copy link
Member

@plankter sorry for the long delay with the CRAN update -- I will do some final checks this weekend and push it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants