Open utterances-bot opened 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.
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.
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 @.***
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!"
That's fascinating :D I didn't know there was this cultural difference between West and East Germany.
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