Hi,

I used to use reshape and moved to reshape2 (R 2.15.1). Now I tried some of my 
older scripts and was surprised that my cast function wasn't working like 
before.
What I did/want to do:
1) Melt a dataframe based on a vector specifying column names as measure.vars. 
Thats working so far:
dfm <- melt(df, measure.vars=n, variable_name = "species", na.rm = FALSE)

2) Recast the dataframe:
dfc <- cast(dfm, Var1 + Var2 + Var3 + Var4 ~ species,max) # with reshape
dfc <- dcast(dfm, Var1 + Var2 + Var3 + Var4 ~ species,max) # with reshape2

but then I get (this is new to reshape2!) a warning message:
In .fun(.value[0], ...) : no non-missing arguments to max; returning -Inf

The result seems to be similar (but I haven't checked it yet properly)? A 
message to ignore?

I use melt/cast/melt e.g. for multiple measurements (similar name in one 
column) to get only one row (one measurement) with e.g. the max value. Of 
course during the procedure I can also use cast/melt to drop columns that are 
not relevant for further processing.

/Johannes

______________________________________________
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.

Reply via email to