The do.call
function is very useful here:
A <- 1:10
B <- 11:20
C <- 20:11
> do.call(cbind, list(A,B,C))
[,1] [,2] [,3]
[1,] 1 11 20
[2,] 2 12 19
[3,] 3 13 18
[4,] 4 14 17
[5,] 5 15 16
[6,] 6 16 15
[7,] 7 17 14
[8,] 8 18 13
[9,] 9 19 12
[10,] 10 20 11
Related Contents:
- Find complement of a data frame (anti – join)
- How to find the statistical mode?
- Overlap join with start and end positions
- Left join using data.table
- Workflow for statistical analysis and report writing
- Why does X[Y] join of data.tables not allow a full outer join, or a left join?
- dplyr: inner_join with a partial string match
- How to make execution pause, sleep, wait for X seconds in R?
- R tick data : merging date and time into a single object
- Why am I getting “algorithm did not converge” and “fitted prob numerically 0 or 1” warnings with glm?
- Linear Regression loop for each independent variable individually against dependent
- Changing whisker definition in geom_boxplot
- Non-equi join using data.table: column missing from the output
- data.table join then add columns to existing data.frame without re-copy
- Use merge() to update a data frame with values from a second data frame
- R: data.table cross-join not working
- Add error bars to show standard deviation on a plot in R
- Function to calculate R2 (R-squared) in R
- Select only the first row when merging data frames with multiple matches
- Rolling join on data.table with duplicate keys
- Plotting a 3D surface plot with contour map overlay, using R
- Update subset of data.table based on join
- Geometric Mean: is there a built-in?
- How to generate distributions given, mean, SD, skew and kurtosis in R?
- Exact number of bins in Histogram in R
- Merging multiple data.tables
- Standard Deviation in R Seems to be Returning the Wrong Answer – Am I Doing Something Wrong?
- Conditional binary join and update by reference using the data.table package
- predict.lm() in a loop. warning: prediction from a rank-deficient fit may be misleading
- Transpose / reshape dataframe without “timevar” from long to wide format
- Remove space between plotted data and the axes
- In R, how to get an object’s name after it is sent to a function?
- Remove part of string after “.”
- Extracting specific columns from a data frame
- Removing duplicate combinations (irrespective of order)
- Convert column with pipe delimited data into dummy variables [duplicate]
- Find how many times duplicated rows repeat in R data frame [duplicate]
- R: Plotting a 3D surface from x, y, z
- How to move cells with a value row-wise to the left in a dataframe [duplicate]
- How to omit NA values while pasting numerous column values together?
- Dealing with TRUE, FALSE, NA and NaN
- Add empty columns to a dataframe with specified names from a vector
- ggplot2: Curly braces on an axis?
- Decompress gz file using R
- Using multiple criteria in subset function and logical operators
- How to access and edit Rprofile? [closed]
- Generate paired stacked bar charts in ggplot (using position_dodge only on some variables)
- Why is as.Date slow on a character vector?
- if/else constructs inside and outside functions
- How convert decimal to POSIX time