A place for glue and glue related products

stevensanderson,
@stevensanderson@mstdn.social avatar

Some one just reached out looking to extract values from a cell that are produced by from the

Example a cell value like 251 (13%) they just want the 251, so I did something like this:

library(tidyverse)
tibble(
value = glue::glue("{11:20} ({1:10}%)"),
reged_val = str_extract(value, "\d+(?=\W|$)") |>
as.numeric()
)

A tibble: 10 × 2

value reged_val
<glue> <dbl>
1 11 (1%) 11

Thoughts?

#R

gavin,

@stevensanderson

I would use the separate_wider_* functions in {tidyr}

For example:
library(tidyverse)
tibble(
value = glue::glue("{11:20} ({1:10}%)"),
reged_val = str_extract(value, "\d+(?=\W|$)") %>%
as.numeric()
) %>%
separate_wider_delim(
value,
names = c("value_separated", NA),
delim = " ",
cols_remove = FALSE
)

ataustin,
@ataustin@fosstodon.org avatar

@stevensanderson
I'm a bit of a troglodyte in this area but assuming I knew the pattern this precisely, I would probably just create a new column with
as.integer(gsub(" .*", "", value))

ai6yr,
@ai6yr@m.ai6yr.org avatar

LOL one of these is a recipe for glue, the other is a recipe for cheese.

Picture of recipe ingredients, milk, lemon juice, vinegar

pixel,
@pixel@social.pixels.pizza avatar

@ai6yr cheese + baking soda = glue

ai6yr,
@ai6yr@m.ai6yr.org avatar

@pixel 😂

MMGirlfriend,
@MMGirlfriend@toot.community avatar

The 10yo grabbed a peeling fire hydrant and got metal shards in his hand. Too small for a tweezers. Fortunately, I am a child of the 80s and 90s. I covered his hand in glue, let it set, and peeled the most satisfying batch of “picky skin.” Now he’s obsessed.

RedtheBean,

hey I on real quick for free if you want one to out and onto a piece of and give to your hot for because the is so and

YourWifeAsWellJustNotingThat

waag, Dutch
@waag@waag.social avatar

Kom aankomende week je design-hart ophalen bij de Waag tijdens , de vierdaagse designtour in Amsterdam. In de Waag laten kunstenaars en ontwerpers je zien dat grootschalige, vervuilende productieprocessen iets van het verleden zijn: het kán anders. https://waag.org/nl/event/waag-x-glue-amsterdam/

image/jpeg
image/jpeg
image/png

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