@_wurli@fosstodon.org
@_wurli@fosstodon.org avatar

_wurli

@_wurli@fosstodon.org

Software developer 👨‍💻 | operational researcher 👨‍🔬 | data scientist 📊 | #RStats enthusiast

I also like to play guitar 🎸

This profile is from a federated server and may be incomplete. Browse more on the original instance.

_wurli, to random
@_wurli@fosstodon.org avatar

Bizarre discovery of the week: control-flow statements don't necessarily have to be within a set of braces, unless the code it at the 'top level'. Super weird.

https://github.com/r-lib/tree-sitter-r/issues/103#issuecomment-2088580114

_wurli,
@_wurli@fosstodon.org avatar

@gaborcsardi Aha! So it's just the else which causes some funkiness? I did some digging for the relevant documentation but struggled to find anything official about this.

_wurli, to random
@_wurli@fosstodon.org avatar

I'm asking about graphics devices on Stackoverflow - offering a +200 bounty for a canonical answer to whether we can hijack the default interactive devices somehow... Any answers appreciated!

Shamelessly tagging to bring to the attention of the Mastodon council of R graphics wizards: @coolbutuseless @yjunechoe @teunbrand

https://stackoverflow.com/questions/78303725/how-can-i-use-a-non-standard-graphics-device-interactively

_wurli, to random
@_wurli@fosstodon.org avatar

Made this cheatsheet for best practice a while ago for use in my workplace. Been recently thinking a bit more about how we can encourage folks to tighten up their workflows. Any approaches people have taken which have proved effective?

PDF on GitHub: https://github.com/wurli/r-best-practice

_wurli, to random
@_wurli@fosstodon.org avatar

PSA: {cli} pluralisation is magic 🧙‍♂️

brodriguesco, to python
@brodriguesco@fosstodon.org avatar

so mods removed the post, but what do you think? agree/disagree

_wurli,
@_wurli@fosstodon.org avatar

@brodriguesco My #1 wishlist feature for Python is syntactic macros. Whenever I code something serious, I always end up frustrated by the limitations of the syntax. I think this would solve that problem. There’s a draft PEP for this, but hasn’t shown any signs of movement for a while: https://peps.python.org/pep-0638/

_wurli, to random
@_wurli@fosstodon.org avatar

Interested to hear how folks track their own time/to-do lists in a work setting.

I've tried lots of methods which haven't really worked for me, e.g:

  • OneNote, colour coding bullet points based on status

  • Outlook, marking emails as 'to do'

  • Random snippets written in Notepad

For the past few months I've been using a folder of markdown docs. Each project/person I manage gets their own doc, and I edit them with vim. It's simple, quick, flexible, and seems to be working well for me so far.

_wurli,
@_wurli@fosstodon.org avatar

@gmschroe Been considering using Obsidian, heard nothing but good things. The difficulty in my situation is that, leading a team of data scientists, our work often isn't formal enough to lend itself well to tools like Jira, Kanban, etc, and it's deffo not all development, so GitHub/AZURE DevOps aren't great solutions either. For team work/time tracking I've set up a Gantt chart in Excel, which seems to be working okay. Individual to-dos I'm tracking using my own adhoc markdowns.

sckottie, to random
@sckottie@fosstodon.org avatar

just starting to ply with shinytest - curious if there are other pkgs out there for testing shiny? curious because it seems like it's not being actively worked on looking at commits and issues

_wurli,
@_wurli@fosstodon.org avatar
_wurli, to random
@_wurli@fosstodon.org avatar

When an package is deprecated or superseded in favour of another one, should maintainers add a field to the DESCRIPTION file to indicate the now preferred package?

One benefit might be that tools like {pak} could alert you if you directly install a superseded package...

_wurli, to random
@_wurli@fosstodon.org avatar

Introducing {updateme} - an package for keeping packages up to date 📦🔄 Usage is simple - just run library(updateme) to get helpful messages about new packages 💫

Still experimental, but can be tested! I'm already finding it super useful:

https://github.com/wurli/updateme

video/mp4

_wurli, to meta
@_wurli@fosstodon.org avatar

syntax idea: f(unction)-strings.

One could define a function to operate on a single string like so:

g" <- function(x) {
glue::glue(x, .envir = parent.frame())
}

This would basically give you something very similar to Python's f-strings:

g"1 + 1 = {1 + 1}"
#> [1] "1 + 1 = 2"

This idea comes from , which lets you define non-standard string literals in the same way: https://docs.julialang.org/en/v1/manual/metaprogramming/#meta-non-standard-string-literals

For me, this actually feels in keeping with R's stripped back, functional vibe.

_wurli, to random
@_wurli@fosstodon.org avatar

PSA: is incredibly good. Don't want to leave RStudio? No problem - it even runs great from the integrated terminal:

https://github.com/jesseduffield/lazygit

_wurli, to Excel
@_wurli@fosstodon.org avatar

A few tweaks to {pivotr} over the last few days - doubt I'll touch it again for a while, but overall very happy with how it's turned out🤸‍♂️

{pivotr} is an /shiny tool similar to 's PivotTables, but it also generates dplyr/tidyr code for you:

https://github.com/wurli/pivotr

video/mp4

_wurli, to ChatGPT
@_wurli@fosstodon.org avatar

Observation: when first hit the popular media, like everyone else, I was amazed by how human its responses were. Just over a year later, AI-generated text is everywhere, and I'm now equally amazed by how easy it is to spot.

_wurli, to python
@_wurli@fosstodon.org avatar

Currently learning as a long-time guy. Posting my thoughts as I go along.

R's {devtools} makes package development really nice:

  1. Write code
  2. Reload package with ctrl + shift + L
  3. Test the new code
  4. Go to (1).

I'm using for package development in Python, and I haven't found a workflow that feels half as nice as this. Am I missing something? Has anyone out found a system that does feel good to use?

More details on stackoverflow: https://stackoverflow.com/questions/77706005/best-workflow-for-python-package-development-in-vscode

_wurli,
@_wurli@fosstodon.org avatar

@slackline Thanks! I've been using pip install -e up to now, the pain point is having to repeatedly fire up the REPL, load my package, quit the REPL again when developing. Perhaps a REPL-based workflow just isn't the way to go...

_wurli,
@_wurli@fosstodon.org avatar

@slackline 🤔 it does currently feel like I'm just not doing things in the intended way, so maybe I need to figure out a new paradigm for development. As already bemoaned, this kind of development feels great in and I'm gonna miss it if that's the case. But not everything can be R.

_wurli,
@_wurli@fosstodon.org avatar

@slackline Hm, neither really feel like great solutions to me 😕 Maybe the best option is to just maintain testing scripts and run them all at once, e.g:

> python dev/dev.py

Wouldn't get the REPL-y goodness but at least it would feel fluid.

_wurli,
@_wurli@fosstodon.org avatar

@grrrck @slackline Thanks! I haven't found a way to get this to reload changes in a package installed with pip install -e unfortunately :(

_wurli,
@_wurli@fosstodon.org avatar

@grrrck @slackline Aha, that might be it. Thanks for the tip! Still, I think it's weird there doesn't seem to be a better solution out there.

_wurli, to python
@_wurli@fosstodon.org avatar

My solution to day 6. This was a really nice problem! It was a good feeling to break out the old quadratic formula after probably 4+ years.

image/png

_wurli, to python
@_wurli@fosstodon.org avatar

My solution to day 5. Part 1 was a (relative) breeze, but part 2 was pure pain. That said, both parts now run in ~0.2 seconds, which is not too bad.

_wurli, to random
@_wurli@fosstodon.org avatar

Hey , I've just updated the cheatsheet for best practice in R 😀

Feel free to adapt this for your own use 💫

https://github.com/wurli/r-best-practice

_wurli, to random
@_wurli@fosstodon.org avatar

Genuine question: are there any tools outside of that come close to dplyr + tidyr + purrr for data wrangling?

_wurli,
@_wurli@fosstodon.org avatar

@datamaps @JorisMeys

There's definitely a case to be made for 'classic' R syntax. It's terse, but elegant.

Personally, I favour readability, particularly for data wrangling, which is often hard enough to understand when the code is readable.

I disagree about dplyr being a tool to avoid due to deprecations - it's evolved over time, but in 4 years I've never had previously working code break in a new version. Incidentally, this issue: https://github.com/Rdatatable/data.table/issues/5656

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • Durango
  • tacticalgear
  • thenastyranch
  • magazineikmin
  • hgfsjryuu7
  • DreamBathrooms
  • Youngstown
  • slotface
  • ngwrru68w68
  • PowerRangers
  • everett
  • kavyap
  • rosin
  • Leos
  • vwfavf
  • cubers
  • GTA5RPClips
  • osvaldo12
  • InstantRegret
  • mdbf
  • khanakhh
  • modclub
  • tester
  • cisconetworking
  • ethstaker
  • normalnudes
  • provamag3
  • All magazines