Problem description
Count_bind = rbind(count_left,count_right)
Error in match.names(clabs, names(xi)) : names are not relative to existing names
To explore the reason
This is a problem in the match.names function that occurs during rbind, for the simple reason that my first two objects to be rbind have different column names:
To solve the problem
Manually changing the column name can solve the problem:
colnames(count_left) <- c("AAA")
Use the above function to execute the two objects separately, and just change the column name.
Big mouth a
I’ve never really understood why data.frame cannot set the column name when declared but can set the row name. Below is the official usage, only for row row.
The data frame (… , row.names = NULL, check.rows = FALSE,
check.names = TRUE, fix.empty.names = TRUE,
stringsAsFactors = default.stringsAsFactors())
In this way, I often have to manually name the column names of the data box. Usually, the code I write is genetic data, so as to ensure the accuracy of the column names. However, it would be troublesome to write small codes for statistics
Welcome to communicate
Read More:
- R language error in match.names (clabs, names(xi)) :
- Methods of modifying index and columns names by dataframe in pandas
- Command failed with error 16412: ‘FieldPath field names may not contain ‘.‘.‘ on server 10.21.20.8:2
- Adding prefixes to file names in batch by shell under mac
- Nginx configures different domain names to access different projects
- The sparse matrix of R language is too large to be used as.matrix
- Usage and examples of three important functions of tidyr package in R language: gather, spread and separate
- Bash modifies the file names in the specified folder through MAC terminal (batch modification)
- Errors in IntelliJ ieeasql statements and table names in @ table
- Renaming the column name of data frame in R language
- R language error:‘ namespace:lazyeval There is no exit_ The object is eval
- Batch modification of file names on MAC Linux rename command line
- Solving the problem of saving object set by save() function in R language
- The solution of “error in NLS loop more than 50” in R language
- Error analysis of multiple linear regression in R language model.frame.default
- R language-Error in file(out, “wt”): Unable to open the link problem solved
- In R language, for loop or array truncation, the following error occurs only 0’s may be mixed with negative subscripts
- R language notes – sample() function
- R language error in hist.default ():’x’must be a value
- Trivia: How does R language solve Error in ts(x):’ts’ object must have one or more observations