Dplyr Tidyyeval用于构建变量名称

时间:2017-06-27 22:26:24

标签: r dplyr lazy-evaluation rlang

我正在尝试构建一个允许我在以特定前缀开头的列上执行函数的函数。我正在努力弄清楚如何让名字评估正确的事情。

我查看了[ 63.327733] ---[ end trace f1f2a7c1833acf6b ]--- [ 63.327787] CPU: 1 PID: 156 Comm: irq/18-abc-xxx Tainted: G W O 4.11.0 #6 [ 63.327844] task: a80000804f31e680 task.stack: a800008045f7c000 [ 63.327886] $ 0 : 0000000000000000 ffffffff80192a30 ffffffffc001f794 0000000000040b00 [ 63.327974] $ 4 : 0000000000000012 a80000804f282400 000000001400fde0 ffffffffffff00fe [ 63.328062] $ 8 : fffffffffffffffc a8000000814d0000 0000000000000000 00000000000007ff [ 63.328150] $12 : a800008045f7fdd8 000000000000fd00 0000000000000000 0000000000000000 [ 63.328237] $16 : a80000804f991380 ffffffff80192608 a80000804f268a00 a80000804f9913c0 [ 63.328326] $20 : ffffffff80190000 ffffffff808c3440 ffffffff808d0000 0000000000000001 [ 63.328415] $24 : 0000000000000000 ffffffff80254440 [ 63.328501] $28 : a800008045f7c000 a800008045f7fdc0 ffffffff808c3440 ffffffff80192640 [ 63.328592] Hi : a80000804f9913c0 [ 63.328625] Lo : ffffffff80190000 [ 63.328691] epc : ffffffffc001f794 xxx_thread_irq+0x0/0x24 [jsp] [ 63.328747] ra : ffffffff80192640 irq_thread_fn+0x38/0x64 [ 63.328789] Status: 1400fde3 KX SX UX KERNEL EXL IE [ 63.328868] Cause : 00800400 (ExcCode 00) [ 63.328904] PrId : 0001a900 (MIPS I6400) [ 63.328950] CPU: 1 PID: 156 Comm: irq/18-aaa-xxx Tainted: G W O 4.11.0 #6 [ 63.328999] Stack : 0000000000000049 0000000000000049 ffffffff814841da 0000000000000000 [ 63.329085] ffffffff808d0000 0000000000000049 0000000000000049 ffffffff8018de40 [ 63.329172] 0000000000000000 ffffffff8018e61c ffffffff808c0000 0000000000000000 [ 63.329258] ffffffff808c0000 ffffffff807aa838 a80000804f31e680 ffffffff8147e5b0 [ 63.329346] 000000000000009c 0000000000000001 a80000804f09be7c ffffffff808d0000 [ 63.329432] ffffffff808cc080 ffffffff8018c54c a80000804f09bd20 0000000000040b00 [ 63.329520] ffffffff808c9b87 ffffffff8018f598 0000000000010000 ffffffff807aa838 [ 63.329607] 0000000000000001 000000000000009c a80000804f09bc48 0000000000000000 [ 63.329693] ffffffff804a888c 000000001400fde0 0000000000000000 0000000000000000 [ 63.329779] 0000000000000000 0000000000000000 ffffffff8010e96c 0000000000040b00 [ 63.329865] ... [ 63.329903] Call Trace: [ 63.329941] [<ffffffff8010e96c>] show_stack+0x68/0xbc [ 63.329994] [<ffffffff804a888c>] dump_stack+0xdc/0x110 [ 63.330055] [<ffffffff801be074>] flush_smp_call_function_queue+0x12c/0x1fc [ 63.330119] [<ffffffff80113a44>] ipi_call_interrupt+0x18/0x28 [ 63.330177] [<ffffffff80190f9c>] __handle_irq_event_percpu+0xa8/0x25c [ 63.330238] [<ffffffff8019118c>] handle_irq_event_percpu+0x3c/0x98 [ 63.330297] [<ffffffff80191240>] handle_irq_event+0x58/0x90 [ 63.330355] [<ffffffff80195fc0>] handle_edge_irq+0x168/0x1a4 [ 63.330411] [<ffffffff8018feb4>] generic_handle_irq+0x2c/0x3c [ 63.330472] [<ffffffff804e8c74>] gic_irq_dispatch+0x220/0x274 [ 63.330528] [<ffffffff8018feb4>] generic_handle_irq+0x2c/0x3c [ 63.330586] [<ffffffff80736a94>] do_IRQ+0x24/0x30 [ 63.330642] [<ffffffff804e4f3c>] plat_irq_dispatch+0xf4/0x128 [ 63.330697] [<ffffffff80101234>] handle_int+0x134/0x140 [ 63.330771] [<ffffffffc001f794>] xxx_thread_irq+0x0/0x24 [jsp] [ 63.330850] [<ffffffff80192640>] irq_thread_fn+0x38/0x64 [ 63.330906] [<ffffffff80192a30>] irq_thread+0x144/0x27c [ 63.330961] [<ffffffff8015d368>] kthread+0x180/0x188 [ 63.331014] [<ffffffff80100ed4>] ret_from_kernel_thread+0x14/0x1c 网站,其中讨论了programming,但无法弄清楚如何正确评估它。

我在CRAN(v0.70)上使用了最新版本的dplyr,其中@hadley引入了dplyr

Reprex

tidyeval

1 个答案:

答案 0 :(得分:1)

!!width返回字符串 "a_width"。您必须!!sym(width)将其转换为名称。同样适用于!!height