Maybe this –
df <- data.frame(matrix(ncol = 10000, nrow = 0))
colnames(df) <- paste0("hello", c(1:10000))
And @joran’s suggestion – df <- setNames(data.frame(matrix(ncol = 10000, nrow = 0)),paste0("hello", c(1:10000)))
More Related Contents:
- Dynamically select data frame columns using $ and a character value
- Simultaneously merge multiple data.frames in a list
- Count number of rows within each group
- Drop unused factor levels in a subsetted data frame
- Why is it not advisable to use attach() in R, and what should I use instead?
- Create an empty data.frame
- Merging a lot of data.frames [duplicate]
- Create a group number for each consecutive sequence
- Subset data frame based on multiple conditions [duplicate]
- dplyr: nonstandard column names (white space, punctuation, starts with numbers)
- R – Concatenate two dataframes?
- Calculating statistics on subsets of data [duplicate]
- Identifying duplicate columns in a dataframe
- R pass variable column indices to ggplot2 [duplicate]
- How to access the last value in a vector?
- What can R do about a messy data format?
- Same function over multiple data frames in R
- Create empty data frame with column names by assigning a string vector? [duplicate]
- Dataframe create new column based on other columns
- What is about the first column in R’s dataset mtcars?
- Last Observation Carried Forward In a data frame? [duplicate]
- Determine the data types of a data frame’s columns
- What is difference between dataframe and list in R?
- Define dimensions of an empty dataframe
- Merge overlapping ranges into unique groups, in dataframe
- Reshape a dataframe to long format with multiple sets of measure columns [duplicate]
- Convert a data frame to a data.table without copy
- How can I merge more than 2 dataframes in R by rownames?
- Identifying where value changes in R data.frame column
- What is the first column in R’s mtcars dataset?