Clarification on use of .. (dot dot)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- r
- Ambito
- documentation
Direzione di ricerca
Inizia con la documentazione della pagina delle novità citata nell’issue e confronta gli esempi mostrati DT[,mpg], DT[,get(colname)] e DT[,..colname], incluso il loro comportamento con first(). Chiarisci la distinzione documentata tra la selezione dei nomi delle colonne e la selezione dei valori delle colonne, e assicurati che gli esempi descrivano accuratamente i risultati attesi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The .. feature for fetching column names stored in character vectors is documented in the news page as:
When j is a symbol prefixed with .. it will be looked up in calling scope and its value taken to be column names or numbers.
This implies that it works similarly to typing the column name directly (had it been known at the time of writing the code). However that does not seem to be the case. E.g.
DT <- data.table(mtcars)
colname <- "mpg"
Both DT[,mpg] and DT[,get(colname)] return a vector of values. But DT[,..colname] returns a data.table.
This confused me because it has implications for calling functions on the column. E.g. I attempted to use first(): both DT[,first(mpg)] and DT[,first(get(colname))] return 21. But DT[,first(..colname)] returns 'mpg', which is the column name.
If this is expected behaviour, please will the documentation clarify the use? Thank you
- Lingua principale
- R
- Stelle
- 3.9k
- Fork
- 1.1k
- Merge medio
- 15h 51m
- PR unite (30g)
- 3
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Rdatatable/data.table
-
as.data.table() recurses without end on a survival::Surv object (or any data.frame carrying one)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Rdatatable/data.table#7887 ·
-
consistency tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Rdatatable/data.table#7853 · 3 commenti ·
-
internals
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Rdatatable/data.table#6938 · 1 commento ·
-
encoding fread
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Rdatatable/data.table#5179 · 8 commenti ·
-
[rbind|cbind|merge]list joins
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
Rdatatable/data.table#7906 ·
Tutte le issue di Rdatatable/data.table
Issue simili
-
Component: R Type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/arrow#51695 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug priority: should
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
The-Strategy-Unit/nhp_outputs#477 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
InseeFrLab/melodi#27 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Open-Systems-Pharmacology/OSPSuite.ReportingEngine#1380 · 1 commento ·