Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Question]: Making easier to add piped expression to qenv

Aperta
#369 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
r
Ambito
data

Direzione di ricerca

Inizia confrontando il modo in cui le API esistenti qenv e within acquisiscono e validano le espressioni e il modo in cui get_code le renderizza. Esamina il workflow add_pipe proposto e la sua interazione con teal_data. Il lavoro è completato quando è possibile aggiungere una pipe incompleta e continuare attraverso più chiamate, rimandando la validazione fino alla terminazione dell’espressione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

core question
What is your question?

With within is very easy to add a complete expression to qenv.

The pipe has the benefit of reducing the allocation of variables and removing a parameter as is passed implicitly and potentially make code more readable.
R users use/expect pipes (%>% and |> mostly) and often they are created step by step.
If the piped expression is not completed it results in an error, so module developers need to write first the complete expression and then add it to the qenv/teal_data:

library("qenv")
q <- within(qenv(), {
  p <- penguins
})

within(q, {
  p %>% 
    subset(!is.na(sex)) %>% 
})
#> Error: unexpected '}' in:
#> "    subset(!is.na(sex)) %>% 
#> }"

It would be great if there were some method/function to be able to append an incomplete piped expression to be continued.
An idea:

q2 <- add_pipe(q, {p <- p %>% subset(!is.na(sex))}, pipe = "%>%")
cat(get_code(q2))
#> p <- penguins
#> p<- p %>% subset(!is.na(sex)) %>% { }

q3 <- add_pipe(q2, {head()}, pipe = "")
cat(get_code(q3))
#> p <- penguins
#> p <- p %>% subset(!is.na(sex)) %>% head()

Adding an empty character instead of the (default?) pipe could signal the end of the pipeable expression.
Only then the code would be verified.

Code of Conduct
  • I agree to follow this project's Code of Conduct.
Contribution Guidelines
  • I agree to follow this project's Contribution Guidelines.
Security Policy
  • I agree to follow this project's Security Policy.
Lingua principale
R
Stelle
11
Fork
9
Merge medio
6g 2h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di insightsengineering/teal.data

Tutte le issue di insightsengineering/teal.data

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.