@jimgar@hachyderm.io
@jimgar@hachyderm.io avatar

jimgar

@jimgar@hachyderm.io

Data analyst, :rstats: fan, boulderer, and community gardener in Edinburgh .

I will follow back if you post mostly about #RStats and related topics, or workplace culture.

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

bentoh, to vscode
@bentoh@mastodon.online avatar

So over the past year I have been using for my and work. my workplace is trying to move to a unified IDE, and vscode allows remote access and WSL integration for free. However, so far it fails to spark joy in me like (despite lack of mode) and do. Everything feels clunky, and subpar. The "intelligent" and linting things are also quite broken in R... Has there been extensions that fundamentally change the vscode experience that I should be trying?

jimgar,
@jimgar@hachyderm.io avatar

@bentoh What is your current setup like?

jimgar,
@jimgar@hachyderm.io avatar

@bentoh In my experience the Python stuff is more complex because so much of the ecosystem is repetitive and just a lot of very similar variations. You may find that having Black and Ruff both enabled is part of the problem because the latter is a drop-in replacement for the former, plus it’s a linter.

For R you at minimum need the R extension and the R package {languageserver}, but also ideally you’ll want the radian terminal too.

jimgar,
@jimgar@hachyderm.io avatar

@bentoh For R I wrote a guide for macOS users, but most of it applies to Windows too from what I can tell. It’ll probably be obvious which bits - where you set the paths in the settings json and stuff like that. I hope you find it helpful :)

https://jimgar.github.io/posts/vs-code-macos-r/post.html

mattdray, to random
@mattdray@fosstodon.org avatar
jimgar,
@jimgar@hachyderm.io avatar

@mattdray Still open to hearing views about that subset warning…

https://hachyderm.io/@jimgar/112021673837289930

jimgar, to random
@jimgar@hachyderm.io avatar

TIL @hrbrmstr ‘s handle is read aloud as “Harbour master”, or can be. Which is definitely better than what I’ve been saying in my head the past 18 months, “Herbert hamster” 🐹 🥲 https://fosstodon.org/@josi/112388541647800781

jimgar,
@jimgar@hachyderm.io avatar

@hye @hrbrmstr @adamhsparks Haha… could still be true!?

jimgar, to random
@jimgar@hachyderm.io avatar

I’ve been reading Advanced R and it’s got me daydreaming. If there was a Python 2 to Python 3 type reckoning for R, what would be the changes you’d want implemented?

I’m a ‘not beginner’ who regularly interacts with beginners, so for me it would be

  • Clean break from anything that exists “for compatibility with S”
  • Total rewrite of the base docs for normal humans, with simple examples before all else… (1/3)
Drmowinckels, to programming
@Drmowinckels@fosstodon.org avatar

📝 New blog post 📝

'The IDEs I use'

🧏 People who code have a tendency to spend a lot of time in various IDEs (Integrated Development Environments). They can be as simple as a text editor or as complex as a full-blown development environment. In this post, I'll go through my two go-to IDE's, RStudio and VScode, and why I switch between them rather than sticking to a single one. ---

👀 Read more at https://drmowinckels.io/blog/2024/ide

#R

jimgar,
@jimgar@hachyderm.io avatar

@almenal99 @Drmowinckels I’m getting into Neovim at the moment and think, after extensive experience with RStudio and VS Code, that I disagree on its status as IDE! 😝 Especially compared to VS Code I think it’s super promising - it can look incredibly beautiful, great plugins for file trees, syntax highlighting, linting, project search, git integrations. I’m not sure where it stands on the data viewer front. (1/2)

jimgar,
@jimgar@hachyderm.io avatar

But it’s very fast, which I can’t say for VS Code.

I’m curious why VS Code can be considered an IDE for R but Neovim can’t, considering both need extensions/plugins to become more than a text editor?? (2/2)

jimgar,
@jimgar@hachyderm.io avatar

@Drmowinckels lowers hood of black robe it’s not a cult ok???

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

Discover efficient string splitting in R using strsplit()!

Learn practical examples and unleash the power of regular expressions.

Enhance your data cleaning skills and level up your R programming.

Experiment with strsplit() today!

Post: https://www.spsanderson.com/steveondata/posts/2024-04-26/

#R

image/png

jimgar,
@jimgar@hachyderm.io avatar

@stevensanderson It’s a good one.

I know many of us are still sleeping on raw strings in R, so check this out!

fruit <- “apple,orange banana -grape pineapple”

strsplit(fruit, r”{[,\s-]}”, perl = TRUE)

stevensanderson, to Excel
@stevensanderson@mstdn.social avatar

Having fun trying to generate banner images for my upcoming book:

Extending Excel with Python and R

Amazon: https://packt.link/oTyZJ

#R

image/png

jimgar,
@jimgar@hachyderm.io avatar

@stevensanderson It’s been a while since I picked my copy of Excecel: Extending Excel Pythhon R: Caispmimdrion, by Seglen Icudıh

jeroenooms, to random
@jeroenooms@fosstodon.org avatar

Super proud that r-universe is one of the official season of docs projects, led by @maelle ! https://developers.google.com/season-of-docs/docs/participants

jimgar,
@jimgar@hachyderm.io avatar

@jeroenooms Fantastic. Congrats @maelle and everyone else involved in the proposal process 👏🏻

ramikrispin, to python
@ramikrispin@mstdn.social avatar

How is your Saturday so far? I was able to reduce the size of my Python image by 75% with a multi-stage build 🤩

jimgar,
@jimgar@hachyderm.io avatar

@ramikrispin Wait wait wait… REDUCED? And that’s a huge difference btw 😵. I thought adding steps was supposed to increase the image size. What kind of magic have you used to achieve this?

jimgar, to random
@jimgar@hachyderm.io avatar

I’m curious how many of my fellow useRs working in data/programming fit this rough description

  • No higher ed qualifications in programming/stats/data science degrees
  • A wee bit older, say 30+
  • Done a significant amount of work in non-data or programming roles

Expecting it to be very few, especially on Mastodon. But if that’s you, say hi? :)

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

In base R, we can filter rows where a column is between two values using bracket notation or the subset() function along with logical operators like >=, <=, &, and !. The key is creating a logical test that checks if values are within our desired range.

For example, to filter rows where the column "value" is between 5 and 8

df[df$value >= 5 & df$value <= 8,]

Or with subset()

subset(df, value >= 5 & value <= 8)

Post: https://www.spsanderson.com/steveondata/posts/2024-03-01/

#R

image/png

jimgar,
@jimgar@hachyderm.io avatar

@stevensanderson I’ve been meaning to canvas for opinion on the “Warning” section of subset’s help page.

“Warning

This is a convenience function intended for use interactively. For programming it is better to use the standard subsetting functions like [, and in particular the non-standard evaluation of argument subset can have unanticipated consequences.”

Should this text really be in the help page? (1/2)

jimgar,
@jimgar@hachyderm.io avatar

I’m not qualified to say either way, but still my gut says the potential problem is overblown and therefore so is having a warning. (2/2)

jimgar,
@jimgar@hachyderm.io avatar

@mattdray @stevensanderson Sensibly ice cold take. Appreciate it 👌🏻

brodriguesco, to random
@brodriguesco@fosstodon.org avatar
jimgar,
@jimgar@hachyderm.io avatar

@brodriguesco First of all, I freaking love this codename. But I don’t understand, what’s the deal with the “6th anniversary”? Isn’t it the 24th anniversary of the date given?

brodriguesco, to python
@brodriguesco@fosstodon.org avatar

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

jimgar,
@jimgar@hachyderm.io avatar

@brodriguesco The more I learn, the more I think these kinds of fundamental differences between the two languages are less important? Here’s another Wes McKinney baby: the Ibis guide for dplyr users (where they even give some design credit to the tidyverse) https://ibis-project.org/tutorials/ibis-for-dplyr-users

For simple data analysis this looks pretty much as close as you could get, right?

rabaath, to random
@rabaath@fosstodon.org avatar

On my blog: Why pandas feels clunky when coming from R

https://www.sumsar.net/blog/pandas-feels-clunky-when-coming-from-r/

jimgar,
@jimgar@hachyderm.io avatar

@matthewbadger @rabaath What do you mean by that last point about variable declarations and general purpose programming languages? Could you give a concrete example of when that is an issue in R and wouldn’t be in Python?

jimgar,
@jimgar@hachyderm.io avatar

@matthewbadger @rabaath Pandera is very useful, you are right, we use it at work. But I feel like that pattern of having schemas and enforcing type checking etc should be possible in R, and in the tidyverse. It’s just that the right people haven’t got around to it yet. Maybe I’m just being naive - definitely ignorant!

jimgar,
@jimgar@hachyderm.io avatar

@brodriguesco @rabaath @matthewbadger This doesn’t look equivalent to pandera from what I can tell?

With pandera you define a schema of column names and types, and can also allow/not allow missing values. Then you can enable type enforcement on a data frame. If the schema is violated then you error out informatively.

You can also make your own decorators to specify instead of/in addition to types.

jimgar,
@jimgar@hachyderm.io avatar

@brodriguesco @rabaath @matthewbadger So as a practical example, we use pandera to validate incoming client datasets. There’s a schema per dataset, so when the client sends us X dataset it gets checked against X schema. If there are different column headers, column types, or unexpected null values in the dataset as compared to the schema, the pipeline errors and tells us why. We then know to check the data (and probably go back to the client).

jimgar,
@jimgar@hachyderm.io avatar

@gavin @brodriguesco @rabaath @matthewbadger Nice. Can it tell you the specific value/s that are causing the issue too? In this case the text that didn’t match the regex

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