Displaying 20 results from an estimated 2000 matches similar to: "NADA Data Frame Format: Wide or Long?"
2012 Jul 05
1
reshape2 errors on data frame
I've successfully reformatted data frames from long to wide with reshape2,
but this time I'm getting errors that I want to understand and resolve.
Here's the data frame structure and the results of the melt() and dcast()
functions:
str(waterchem)
'data.frame': 128412 obs. of 8 variables:
$ site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1
2012 Jul 10
2
Understanding cenros Error
Before reading water chemistry into a data frame I removed all missing
data. Yet when I try to run cenros() to summarize a specific chemical I get
an error that I do not understand:
with( subset(chem, param=='Ag'), cenros(quant,ceneq1) )
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'y'
I would like to learn what I did incorrectly
2012 Aug 07
3
NADA Package: Referencing Data Frame Columns
The sample data sets that come with the NADA package are limited to one or
two variables and a censored measurement indicator column. I try to mimic
examples using my data but keep missing the target.
My water chemistry data is available in two formats: long (as seen in a
database table) and wide (as seen in a spreadsheet). The two structures are:
str(chem)
'data.frame': 65349 obs. of
2012 Aug 15
1
NADA package/cenboxplot() method: maximum censored percentage
One set of data has censored (less-than detection limits) water chemistry
concentrations for 80-100% of all observations. My initial trial-and-error
attempts to apply the cenboxplot() method suggests that it has an upper
limit to the percentage of censored observations. I do not see this limit in
Dennis Helsel's second edition.
Has anyone experience plotting censored data and can provide
2012 Aug 07
3
reshape2's dcast() Adds NAs to Data Frame
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,
2011 Nov 29
5
Why Numeric Values Become Factors in Data Frame
I have a data frame with 1 factor, one date, and 37 numeric values:
str(waterchem)
'data.frame': 3525 obs. of 39 variables:
site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ...
$ sampdate : Date, format: "2007-12-12" "2008-03-15" ...
$ CO3 : num 1 1 6.7 1 1 1 1 1 1 1 ...
$ HCO3 : num 231 228 118 246
2012 Jun 05
0
NADA Applied to my Data
I need a nudge in the right direction to get started using NADA. I bought
Helsel's second addition and am currently reading it; NADA is installed in
R.
My data has been restructured with a couple of awk scripts. The data frame
structure now has a flag if the quantity is censored (ceneq1 column) as well
as a lower and upper limit for censored data. For present purposes, interval
censoring
2012 Sep 04
1
cenboxplot(): Reporting Limit Twice Correct Concentration
I've gone over the data and do not see my error; the dput() output of the
data frame and the pdf output of cenboxplot() are attached.
The command used:
cenboxplot(sb.t$quant, sb.t$ceneq1, range=1.5, main='Total Recoverable
Antimony', xlab='Pre-Mining Era', ylab='Concentration (log mg/L)')
(on a single line in emacs).
The RL on the plot is drawn at 0.01 rather
2013 Mar 14
2
NADA and cenmle
Hi,
I am using the cenmle function from the NADA package and some of my data
are negative values. As a result the cenmle function will not work and
NaN's are produced. I try to change the distribution to Gaussian, but it
still will not run.
Could somebody please help me with this?
Thanks
--
Shane
[[alternative HTML version deleted]]
2012 Jun 06
0
R-help Digest, Vol 112, Issue 6
Rich,
The documentation for cenboxplot states that the second argument must be
logical and not integer. the function cenboxplot substitutes synthetic
values for censored values using ros, hence the error message from the ros
method.
I also do not understand how you expect group = 'SO4' to work. It is not
clear that the function will replicate 'SO4' to make a single group.
2012 Aug 22
1
Error in if (n > 0)
I've searched the Web with Google and do not find what might cause this
particular error from an invocation of cenboxplot:
cenboxplot(cu.t$quant, cu.t$ceneq1, cu.t$era, range=1.5, main='Total
Recoverable Copper', ylab='Concentration (mg/L)', xlab='Time Period')
Error in if (n > 0) (1L:n - a)/(n + 1 - 2 * a) else numeric() :
argument is of length zero
I do
2018 May 15
2
Systemfit
OK, Let's try this again! Here is the reproducible script; it is long because I had to copy the panel dataset here. My question is related to systemfit; I don't know how to get the result for the entire panel.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
install.packages("systemfit")
2018 May 16
0
Systemfit
Sadly you failed to set your email program to send plain text and the data is corrupted at my end.
I also think you need to reduce the size of the data set... the intent here is to increase your understanding, not debug your particular analysis.
I will say that I am having a very challenging time understanding what you are trying to accomplish though. What are the equations that you think need
2011 Oct 27
2
Syntax Check: rshape2 melt()
This is my first excursion into using reshape2 and I want to ensure that
the melt() function call is syntactically correct.
The unmodifed data frame is organized this way:
head(tds.anal)
site sampdate param quant
1 UDS-O 2006-12-06 TDS 10800
4 STC-FS 1996-06-14 Cond 280
7 UDS-O 2007-10-04 Mg 1620
9 UDS-O 2007-10-04 SO4 7580
19 JCM-10B 2007-06-21 Ca 79
20
2011 Dec 28
1
subset() missing one factor
The data set (called 'chemdata') has 6 columns (4 factors, 1 date, 1
numeric) and I need to create subsets for each of one of the factors
('stream'). This has worked flawlessly for all but two streams which were
created yesterday.
The command I use to create the subsets is like this:
> rnchH <- subset(chemdata, stream == 'RanchSpgsH', select = c(site, sampdate,
2011 Sep 13
1
ZOO: Learning to apply it to my data
I have read ?zoo but am not sure how to relate the parameters (x,
order.by, frequency, and style) to my data.frame. The structure of the
data.frame is
'data.frame': 11169 obs. of 4 variables:
$ stream : Factor w/ 37 levels "Burns","CIL",..: 1 1 1 1 1 1 1 1 1 1 ...
$ sampdate: Date, format: "1987-07-23" "1987-09-17" ...
$ param : Factor w/
2018 May 15
0
Systemfit
... and the mailing list is picky about attachments... whatever you attached did not conform to the stringent requirements mentioned in the Posting Guide. Pasting the code right into the email is usually safest, though you DO have to post using plain text (as the Posting Guide indicates) or your code may get mangled by the automatic html format removal.
On May 15, 2018 7:04:31 AM PDT, Bert Gunter
2018 May 15
1
Systemfit
Unless there is good reason not to, always cc the list -- there are lots of
smarter folks than I on it who can help.
I may or may not have time to look at this. Hopefully someone else will.
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip
2011 Oct 31
1
reshape2: Lost Values Between melt() and dcast()
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)
Aggregation function missing: defaulting to length
Yet both data frames have the values in their
2011 Oct 24
2
Syntax Help for xyplot()
Thanks to David's help I subset my large data set and produced a smaller
one for a single stream and 7 factors of interest. The structure of this
data frame is:
str(burns.tds.anal)
'data.frame': 718 obs. of 4 variables:
$ site : Factor w/ 143 levels "BC-0.5","BC-1",..: 1 1 4 6 4 4 4 5 5 5
$ sampdate: Date, format: "1996-06-02"