INPUT
specimens: character vector of 60 items:specimen1A, specimen1B, specimen2A ... specimen 30B.
DESIRED OUTPUT
- A matrix or a dataframe in which each item in
specimensis the name of a column in the matrix/dataframe. - The number of rows must be set to a fixed value (any).
- The data for the cells will be filled with subsequent code so can be left as NA.
For example:
specimen1A specimen1B specimen2A ... specimen 30B
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
.. .. .. .. ..
100 NA NA NA NA
Thanks
A data.frame is just a list with some added attributes. Just coerce it:
Edit: Re-reading your problem, I suspect
specimensis a character vector not really a list. If so: