You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, @MilesMcBain , thank you for making this package, it's really convenient and I use it a lot!
I have encountered a problem when using the "Paste as vector" addin quite many times, where long vectors can not be parsed properly after being sent to R console. I used to think that it must be caused by some funny escape characters that I didn't notice. However, today I finally understand the cause with the help of Dirk Eddelbuettel. It is, as he pointed out in this tweet, because R has a limit on the number of characters on one line (~ 4096 characters), and any statement that exceeds this limit will not be parsed properly. This can be a problem when using the "Paste as vector" addin for adhoc data processing, as the result can easily exceed the limit (since there are many quotes, white spaces, and comma characters in the result; the following example contains 900 elements but 4502 characters).
I am aware that "Paste as vector (vertical)" can work around the problem by separating each element on one line. However, I prefer not to use it for two reasons: 1. the result occupies a lot of lines and makes the script hard to navigate; 2. compared to the horizontal format, it is much slower to execute.
I think a good solution is to add line breaks intelligently to the result of "Paste as vector" when it exceeds the limit (of course, now that I understand the cause, I can always add line breaks manually, but this feature may help some users that are not aware of the character-per-line-limit avoid the problem). What do you think?
The text was updated successfully, but these errors were encountered:
I never considered such large amounts of data being used with this function. I suspect this kind of usage is a bit of an outlier, so it's not exactly a priority for me at present, but I would be happy to take a PR.
So when we paste a vector I get a new line added everytime. This is mostly not needed as it reduces the compactness of function calls. Everytime I have to delete the new line.
Consider a simple function call:
setcolorder(dt,c("termid", "veh", "grp"))
This actually becomes the following when I use data pasta's paste vector shortcut:
Hi, @MilesMcBain , thank you for making this package, it's really convenient and I use it a lot!
I have encountered a problem when using the "Paste as vector" addin quite many times, where long vectors can not be parsed properly after being sent to R console. I used to think that it must be caused by some funny escape characters that I didn't notice. However, today I finally understand the cause with the help of Dirk Eddelbuettel. It is, as he pointed out in this tweet, because R has a limit on the number of characters on one line (~ 4096 characters), and any statement that exceeds this limit will not be parsed properly. This can be a problem when using the "Paste as vector" addin for adhoc data processing, as the result can easily exceed the limit (since there are many quotes, white spaces, and comma characters in the result; the following example contains 900 elements but 4502 characters).
I am aware that "Paste as vector (vertical)" can work around the problem by separating each element on one line. However, I prefer not to use it for two reasons: 1. the result occupies a lot of lines and makes the script hard to navigate; 2. compared to the horizontal format, it is much slower to execute.
I think a good solution is to add line breaks intelligently to the result of "Paste as vector" when it exceeds the limit (of course, now that I understand the cause, I can always add line breaks manually, but this feature may help some users that are not aware of the character-per-line-limit avoid the problem). What do you think?
The text was updated successfully, but these errors were encountered: