Use data.table 🙂
library(data.table)
x = c(1,2,3,4,5 )
y = c(2,3,3,1,1 )
z = c(4,3,2,1,1 )
dt<-data.table(x,y,z)
dt[, max:=pmax(x,y,z)]
dt
More Related Contents:
- Finding running maximum by group
- How to find the highest value of a column in a data frame in R?
- How to get the maximum value by group
- How to extract the row with min or max values?
- Is there a vectorized parallel max() and min()?
- Find value corresponding to maximum in other column [duplicate]
- How can I take pairwise parallel maximum or minimum between two vectors?
- min for each row in a data frame
- Is there a dplyr equivalent to data.table::rleid?
- `levels
- Creating arbitrary panes in ggplot2
- Getting path of an R script
- Difference: “Compile PDF” button in RStudio vs. knit() and knit2pdf()
- Rotating x axis labels in R for barplot
- Pass a vector of variable names to arrange() in dplyr
- How subset a data frame by a factor and repeat a plot for each subset?
- change background and text of strips associated to multiple panels in R / lattice
- Convert summary to data.frame
- agrep: only return best match(es)
- How to produce different geom_vline in different facets in R?
- how to pivot/unpivot (cast/melt) data frame? [duplicate]
- What are the performance differences between for-loops and the apply family of functions?
- Cannot install an R package from Github
- Using different scales as fill based on factor
- Conditional binary join and update by reference using the data.table package
- predict.lm() with an unknown factor level in test data
- How to read csv file in R where some values contain the percent symbol (%)
- Specify height and width of ggplot graph in Rmarkdown knitr output
- how to debug “factor has new levels” error for linear model and prediction [duplicate]
- Convert latitude and longitude coordinates to country name in R