I won’t vouch for its speed, but this at least avoids coercing to a matrix:
data[,mymax:=do.call(pmax,.SD)]
More Related Contents:
- Understanding exactly when a data.table is a reference to (vs a copy of) another data.table
- Extract row corresponding to minimum value of a variable by group
- Group by multiple columns and sum other multiple columns
- dcast warning: ‘Aggregation function missing: defaulting to length’
- Left join using data.table
- Fastest way to add rows for missing time steps?
- Summarizing multiple columns with data.table
- How can one work fully generically in data.table in R with column names in variables
- Faster version of combn
- Pass column name in data.table using variable [duplicate]
- What does .SD stand for in data.table in R
- Using lists inside data.table columns
- Perform a semi-join with data.table
- data.table – select first n rows within group [duplicate]
- subsetting a data.table using != excludes NA too
- Find the intersection of overlapping ranges in two tables using data.table function foverlaps
- Referring to data.table columns by names saved in variables
- Dynamic column names in data.table
- Efficient row-wise operations on a data.table
- Replace logical values (TRUE / FALSE) with numeric (1 / 0)
- Using setDT inside a function
- from data table, randomly select one row per group
- How to change type of target column when doing := by group in a data.table in R?
- Insert a row in a data.table
- rolling joins data.table in R
- R data.table apply function to rows using columns as arguments
- R: how to rbind two huge data-frames without running out of memory
- Efficiently merging two data frames on a non-trivial criteria
- assigning by reference into loaded package datasets
- calculating sum of previous 3 rows in R data.table (by grid-square)