AlbertRapp / blogComments

0 stars 0 forks source link

posts/07_janitor_showcase/07_janitor_showcase #15

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Albert Rapp - Showcasing the janitor package

I demonstrate a couple of functions from the janitor package I find quite useful

https://albert-rapp.de/posts/07_janitor_showcase/07_janitor_showcase.html

rccline commented 1 year ago

Interesting: Your code: xl_file <- readxl::read_excel('dirty_data.xlsx', skip = 1) would run when executing from the code chunk, but it would not render with Quarto. I kept getting the error that file could not be found.

AlbertRapp commented 1 year ago

Hi Robert,

this sounds like a working directory problem to me. It sounds like when you're executing the code chunk manually (likely with code output in the console), then the file is in the same working directory. Is this the same directory that the Quarto file is in? By default, Quarto usually uses the Quarto file's location as working directory while rendering.

rccline commented 1 year ago

Thank you for replying. You are absolutely correct. The issues I had resolve with using {here}

skip_1 <- read_excel(here("data/dirty_data.xlsx"), skip = 1)

There seems to be an issue between executing the code manually to create a df object and rendering when using: path = "./path vs path = "../path

Then only way I see to resolve that is with {here}

Robert

On Thu, Dec 29, 2022, at 22:03, AlbertRapp wrote:

Hi Robert,

this sounds like a working directory problem to me. It sounds like when you're executing the code chunk manually (likely with code output in the console), then the file is in the same working directory. Is this the same directory that the Quarto file is in? By default, Quarto usually uses the Quarto file's location as working directory while rendering.

  • Albert

— Reply to this email directly, view it on GitHub https://github.com/AlbertRapp/blogComments/issues/15#issuecomment-1367729734, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALW4MJ6RNO46BW7PJUR2MC3WPZUK7ANCNFSM6AAAAAATMI44TQ. You are receiving this because you commented.AMessage ID: @.***>

Robert C Cline Sr., MA, CPL Sidney, NE @.***

fjodor commented 2 months ago

Nice write-up again, Albert - thank you! Yes, janitor is great. Recently got asked about the rounding issue, my top suggestion was using janitor.

That exact topic led to an awkward, surprising, memorable moment some time ago when I taught an R workshop in Dresden (East Germany): I was busted as originating from the Western part (south, in fact, grew up near Munich). I showed rounding in R, using round(3.5). The participant, who had studied Math in the GDR, asked about rounding 2.5. I didn't get why she would want to know that - it seemed obvious to me. Until I tried it out ... To which she said, "Ah, you're a Wessi!"

https://www.youtube.com/watch?v=WzPmjvi6rr0

AlbertRapp commented 2 months ago

That's fascinating :D I didn't know there was this cultural difference between West and East Germany.