I have a list of data frames:
mylist<-list(df1=data.frame(Var1=c("A","b","c"), var2=
c("a","b","c")), df2= data.frame(var1 = c("a","B","c"),
VAr2=c("A","B","C")))
I would like to change all cases within the column headings and each element of a string to lowercase. (This way when I merge data frames all variables merge correctly and 'cat' vs "Cat' are not read as different entries).
The output would look like:
mylist<-list(df1=data.frame(var1=c("a","b","c"), var2=
c("a","b","c")), df2= data.frame(var1 = c("a","b","c"),
var2=c("a","b","c")))
I have tried the following:
cleandf <- lapply(mylist, function(x) tolower(mylist[x])