-
Notifications
You must be signed in to change notification settings - Fork 4
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
NAs are not allowed in subscripted assignments #15
Comments
@quzhouxiachuan I would love to fix it. Can you give me a reproducible example of error? |
I'm having the same problem, though the debugger is more illuminating of the cause (not related to the input being NA, but rather an NA value in the logical vector used to index Unfortunately I'm having a really hard time getting a reprex that doesn't violate medical ethics ( trying to manually edit raw rtf was a lesson in patience but mainly a lesson in humility and pain ), rtf is the ugliest markup I've ever seen. I will say, however, that the easy fix is probably just to convert those |
I'll put in a PR for the fix when I'm home |
@mstr3336 Thanks, I look forward to seeing that. Do you think you can share a test case too? |
I'll try to share a test case, but unfortunately because I don't really understand the control characters/tokens well enough to narrow it down to a minimal (fully anonymised) valid rtf document, let alone produce my own, I can't make any promises
If I doesn't cause regression bugs that'll be nice though
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Kota Mori <[email protected]>
Sent: Thursday, January 9, 2020 8:33:30 PM
To: kota7/striprtf <[email protected]>
Cc: Matthew Mark Strasiotto <[email protected]>; Mention <[email protected]>
Subject: Re: [kota7/striprtf] NAs are not allowed in subscripted assignments (#15)
@mstr3336<https://github.com/mstr3336> Thanks, I look forward to seeing that. Do you think you can share a test case?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#15?email_source=notifications&email_token=AJMZGQTKNKYN7AKMHPDVI33Q43VOVA5CNFSM4G3TSV72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIPT7YI#issuecomment-572473313>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJMZGQXFK5JVFGZJZPKMZ6LQ43VOVANCNFSM4G3TSV7Q>.
|
@mstr3336 I understand that. No problem. |
I was able to identify the character that caused the NA-
gives
Suggesting that the
section is what's giving us grief. in the "parsed" matrix, we see:
If I perform the following: naughty_pair <- c(55681, 33992)
naughty_char <- intToUtf8(naughty_pair) I get the following: naughty_char
[1] NA This takes place here: Line 130 in 649c245
This is where (at least my) NA was introduced. The question is then - Do I handle the NA (Eg, convert to Or do I handle the NA around in the following block? Lines 172 to 178 in 649c245
My suspicion is that the following line is is intended to provide similar functionality: Lines 173 to 174 in 649c245
However, it's probably best to handle the NA's as soon as they are introduced, so they don't propagate into the logicals, as line 173 also introduces NAs into |
Intended to solve kota7#15 The NAs introduced by this also started tracking into the logical vectors used to subscript assignments / filter empty elements. Replacing them with "" mitigates this
Thanks for considering my PR @kota7 . It's now working for the problem document |
@mstr3336 Thanks for your analysis. If possible, can you share an RTF file that contains that problematic string? |
Hi
I am using strip_rtf() to convert rtf to plain text. I encountered the following errors: strip_rtf(x[8]) Error in out[table_flg] <- paste(row_start, out[table_flg], row_end, sep = "") :
I checked x[8] content, it is not NA.
Could you please help with that?
The text was updated successfully, but these errors were encountered: