View source: R/varsDifferentTypes.R
varsDifferentTypes | R Documentation |
Identifies the variables in common across two dataframes that have different types.
varsDifferentTypes(df1, df2)
df1 |
dataframe 1 (object) |
df2 |
dataframe 2 (object) |
Identifies the variables that have the same name across two dataframes that have different types, which can pose challenges for merging two dataframes.
Dataframe with columns for the variable name, the variable type in df1
and the variable type in df2
.
Other dataManipulation:
columnBindFill()
,
convert.magic()
,
dropColsWithAllNA()
,
dropRowsWithAllNA()
# Prepare Data
df1 <- data.frame(
A = 1:3,
B = 2:4,
C = 3:5
)
df2 <- data.frame(
A = as.character(1:3),
B = 2:4,
C = as.factor(3:5)
)
# Check if any rows are not NA
varsDifferentTypes(df1, df2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.