I want to work on columns and row-names of a bunch of data frames, say W1, W2, W3, whose names are listed in a previously built list, say W. I've seen quite a few similar questions, but none seem to address my difficulty:
> W <- list(W1, W2, W3)
> lapply(W, is.data.frame)
$W1
[1] TRUE
$W2
[1] TRUE
$W3
[1] TRUE
Ultimately what I want to do is:
> lapply(W, function(x) rowname(x) = x[,1])
> lapply(W, function(x) x = x[,-1])
- defines row-names for each data-frame using its first column values.
- suppress the first column after that,
but in both cases I get the content of the first column for each data frame. I'm missing something basic...