top of page
  • Writer's picture♫Shokolatte♬

Codes that are Identical (R)

I love decoding (in conceptual meaning) code functions and be hateful by finding multiple functions that do the same job. But that's when those "single" functions do the same job. On the other hand, I also love finding what combination of function can reroute a data back to the original format. I too often use identical() to verify they are the same, as previously noted in the other blog entry >>> WTF Facts - recode (R).



Today's finding is in below, for the original string data, `txt`;


paste(unlist(strsplit(txt, split = " ")), collapse = " ")

and this is the same as txt. Watch;


identical(txt, paste(unlist(strsplit(txt, split = " ")), collapse = " "))

👇


[1] TRUE


I know, I know, it's nothing fun to anyone that's not interested. But it might save your day some time. 🧐😜





The functions used;




*Btw, since I don't have a relative picture for a preview that goes along with this article today, I am instead leaving a picture that I took from the 84th floor of a business building (in which one of the biggest music streaming company is) in Manhattan, looking down the statue of liberty. Enjoy!




8 views0 comments

Recent Posts

See All

コメント


bottom of page