unable to replace white space in R

Multi tool use
Multi tool use


I am pasting below output of my head command of a BSE stock data column which I use for R programming practice. I googled and tried almost every trick but I am not able to clear white spaces at the end of these values. It seems that all the strings have fixed width of 12 and after characters I see white space which I am unable to remove.



not sure if this will paste in exact same way(e.g. i see a lot of white space after word HDFC in its double quotes) but no technique helped me get rid of those trailing whitespaces.



Base R, without regex:



trimws stands for "trim white space".



You should be able to fix this with sub and a regular expression.



Details:



So the sub statement will identify any string of whitespace characters at the end of the string and replace it with the empty string.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

u,sK0w kTM1DBIM
pT5 i,qkDpa,I5j7 VN UW4RDQrgzr

Popular posts from this blog

The Dalles, Oregon

영화 미래의 미라이 다시보기 (2018) 다운로드 링크 무료보기

Chuyện tình của sao nam Cbiz đem lòng yêu quản lý: Người tìm được chân ái, kẻ vẫn chưa chịu thừa nhận