Better HN
topnewbestaskshowjobs
Log inSign up

Zelazny7

9 karma · joined Jul 6, 2019 (7y ago) · 7 submissions

Submissions

comment 5y ago · link · parent

fraud detection

comment 5y ago · link · parent

Have you figured out a way to add columns to DuckDB from R vectors? I'm not sure this is possible yet without using inefficient insert operations. Ideally, I'd like to pull in some columns from the DB, generate a new column vector and store it back in the DB by adding a column to an existing table.

comment 6y ago · link · parent

when indexing you can always pass `drop=FALSE` to prevent returning a vector. It will always return a matrix or data.frame.

comment 6y ago · link · parent

Base R is fine. I would much rather not include the tidyverse and all of its transitive dependencies.

comment 6y ago · link · parent

  options(error=recover)

comment 7y ago · link · parent

Yeah, that's a valid point. And it took me a couple years to internalize these differences -- mostly by being burned on numerous occasions. Base R has a lot of idiosyncrasies and they have to be memorized, unfortunately.

I develop R packages for my colleagues and so I stick to Base R whenever possible. I don't want my packages depending on the tidyverse at all. But for EDA, I am agnostic about what my colleagues do. They should use the tools that stay out of the way and let them get their hands around the dataset intuitively. For me that's Base R, for others it's data.table or tidyverse.

comment 7y ago · link · parent

I use a simply device to keep these straight:

- (l)apply: List apply always returns a list

- (s)apply: simplify apply tries to return simplified result

- (v)apply: verify apply checks the return type conforms to user supplied example

- (m)apply: multiple apply applies FUN to multiple vectors

- (r)apply: recursive apply is essentially a flatmap

- apply : no device here, only use on matrices, never data.frames