Re: [R] reshape2: Lost Values Between melt() and dcast() [SOLVED]

2011-10-31 Thread Rich Shepard
On Mon, 31 Oct 2011, Rich Shepard wrote: Curious how the database table has a value of 1.00 mg/L and the read data frame contains NA. More curious is why the cast() data frame has a '2' for that row. Further searching in emacs of the text file generated by write.text() I found two rows for

Re: [R] reshape2: Lost Values Between melt() and dcast()

2011-10-31 Thread Rich Shepard
On Mon, 31 Oct 2011, Justin Haynes wrote: I'd look at the outputs of those two dcast calls and find cells where the length is > 1. Those are duplicated entries in your initial data.frames (when I've run into this is was usually due to NA values somewhere unexpected). The dcast() resulting d

Re: [R] reshape2: Lost Values Between melt() and dcast()

2011-10-31 Thread Rich Shepard
On Mon, 31 Oct 2011, Justin Haynes wrote: However, the dcast calls that "failed" can be helpful for determining the source of your error. I'd look at the outputs of those two dcast calls and find cells where the length is > 1. Those are duplicated entries in your initial data.frames (when I've

Re: [R] reshape2: Lost Values Between melt() and dcast()

2011-10-31 Thread Justin Haynes
The reason dcast would give that warning (not a failure) is if the formula you gave did not specify unique values. Thus, dcast needs an aggregating function, which defaults to length. However, the dcast calls that "failed" can be helpful for determining the source of your error. I'd look at the

[R] reshape2: Lost Values Between melt() and dcast()

2011-10-31 Thread Rich Shepard
Working with 5 subset streams from my source data frame, three of them successfully call dcast(), but two fail: jerritt.cast <- dcast(jerritt.melt, site + sampdate ~ param) Aggregation function missing: defaulting to length and winters.cast <- dcast(winters.melt, site + sampdate ~ param) Aggr