I need to understand how and why dcast() adds NAs to a data frame that contained no missing values.
The database table of chemical concentrations has all missing values removed because they cannot contribute to data analyses. The structure of the R data frame of these data have no NA values, and neither does the data frame resulting from applying the reshape2 melt() function to it. However, the data frame produced by the dcast() function does contain NAs for all chemicals. I assume this is because of the syntax I used: chem.cast <- dcast(chem.melt, site + sampdate + era + ceneq1 + floor + ceiling ~ param) How should I reshape the data frame from long to wide without adding these spurious NAs? Rich ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.