Part of a code is ".(test=.N)" When I run it, I get the error "could not find the function "."" I have searched on r documentations and other posts and did not find it. What is the package it belongs to?
Asked
Active
Viewed 51 times
0
-
2It belongs to `data.table` It works only when the object is a data.table i.e. it fails with data.frame. If your object is data.frame or tibble convert to data.table with `as.data.table` or `setDT` – akrun Apr 13 '22 at 18:59
-
Well, without further context, it's not clear. It's most likely the `data.table` package, but any package is free to name a function `.` if they choose. `.` is used as a function in `bquote` for example: `x <- 2; bquote(z-.(x))`. You can even define your own function named `.` It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. – MrFlick Apr 13 '22 at 20:02