weird exception when by contains get

Aperta
#1,985 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
r
Ambito
data

Direzione di ricerca

No source file or test is named. Start by running the supplied data.table example and compare the filtered and unfiltered grouping expressions; done means the filtered expression no longer raises the “object 'z' not found” error and produces the expected grouped result.

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

Descrizione

programming

Just copied my question on stackoverflow:

get function usually works without problems in data.table, but I am not able to understand the reason of this bug.

library(data.table)
tb<-data.table(x=c(1,2), y=c(3,4), z=c(5,6), w=c("a","b"))
tb[w != "b", .(x=sum(x)), by=.(y, zz=z)] #OK
#    y zz x
# 1: 3  5 1
tb[, .(x=sum(x)), by=.(y, zz=get("z"))] #OK
#    y zz x
# 1: 3  5 1
# 2: 4  6 2
tb[w != "b", .(x=sum(x)), by=.(y, zz=get("z"))] #not OK?!

Error in get("z") : object 'z' not found

(I use R version 3.3.2 and data.table version 1.9.6.)

Lingua principale
R
Stelle
3.9k
Fork
1.1k
Merge medio
14h 4m
PR unite (30g)
4

Guida per i contributori

Apri la guida per i contributori

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 Rdatatable/data.table

Tutte le issue di Rdatatable/data.table

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.