-
Notifications
You must be signed in to change notification settings - Fork 3
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
CSV output and markdown #42
Comments
The contents of the cells are formatted with markdown in their default. It would be possible to strip it on output. Can you provide me a little more detail? Are you using "hmisc" for descriptive statistics? All of the individual cell rendering functions are registered in a callback table (see R/cell-hmisc.R). It would be trivial to create a "plain_cell" callback that included no markdown whatsoever and specify that in the transform. I added this due to several requests for differing cell formats but using the same analysis, e.g. use commas instead of decimals in formatting or some variant of ratios/fractions. |
Oh, the callbacks are specific for the transform being used (and one is also free to write their own transforms, but the Hmisc one goes a long way). I've got a new 'smd' one as well that's seeing some use. |
The callbacks are a little confusing to me, but after looking through the vignettes I'm understanding they are linked to the style name. I've been sticking to Hmisc for now. My code looks like this so far:
|
That looks correct. If that's working for you I can add it as a "plain" cell style in the main package. |
Yeah this works, just need row headers to be plain and that would be awesome! Here is what the output of the CSV looks like in my spreadsheet program. It seems like the custom formatted cells are working well and don't have markdown. It's just the headers, which I wasn't sure how to address. (Still have some formatting work to do with stat's function column, but making progress!) Thank you for this project. It is going to be a total lifesaver! |
I haven't looked at the csv code in a long while. It's very much out of date. I think it might be adding all those formatting characters. Give me a few minutes and I may be able to fit this in. |
Okay, I just deleted a bunch of outdated formatting code for csv. I think this gets rid of the formatting characters you are seeing. Install and let me know how that works for you. |
That's perfect! All the formatting characters are gone now. Thanks again for your responsiveness! |
I'm going to leave this open and target it for adding a "plain" style option that has no formatting characters at all. |
Is there a way to strip markdown formatting for specific output types. For example, I'm trying to export a table to CSV and import into Excel. Excel does not parse markdown, so the formatting is unnecessary. I was going to try creating my own style but it seems that markdown is applied to this regardless?
The text was updated successfully, but these errors were encountered: