varsDifferentTypes {petersenlab} | R Documentation |
Identify Variables of Different Types.
Description
Identifies the variables in common across two dataframes that have different types.
Usage
varsDifferentTypes(df1, df2)
Arguments
df1 |
dataframe 1 (object) |
df2 |
dataframe 2 (object) |
Details
Identifies the variables that have the same name across two dataframes that have different types, which can pose challenges for merging two dataframes.
Value
Dataframe with columns for the variable name, the variable type in df1
and the variable type in df2
.
See Also
Other dataManipulation:
columnBindFill()
,
convert.magic()
,
dropColsWithAllNA()
,
dropRowsWithAllNA()
Examples
# 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)
[Package petersenlab version 1.1.0 Index]