Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R's data.table can not find the function "."

Tags:

r

data.table

I read that data.table understands the dot "." as an alias of "list". But:

> dt <- data.table(x = c(11, 22), y = c("f", "b"))
> dt
    x y
1: 11 f
2: 22 b
> dt[,.(y)]
Error in eval(expr, envir, enclos) : could not find function "."
>

Why is that?

like image 558
frank Avatar asked Mar 24 '26 01:03

frank


1 Answers

According to the data.table New features on v.1.9.4 (https://github.com/Rdatatable/data.table),

.() can now be used in j and is identical to list(), for consistency with i.

So, it is better to install either v.1.9.4 version or the devel version from here

like image 189
akrun Avatar answered Mar 26 '26 16:03

akrun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!