search for: sampdat

Displaying 20 results from an estimated 26 matches for "sampdat".

Did you mean: sampdate
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 JCM-10B 2007-06-21 Cl 114 What I want looks like this: site sampdate TDS Cond Mg Ca Cl...
2011 Dec 28
1
subset() missing one factor
...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, param, quant), drop = T) but it does not copy the dates in 'sampdate' for this and one other subset: > str(rnchH) 'data.frame': 0 obs. of 4 variables: $ site : Factor w/ 138 levels "BC-0.5","BC-1",..: $ sampdate:Class 'Date' num(0) $ par...
2012 Jul 05
1
reshape2 errors on data frame
...t 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 1 1 1 1 1 ... $ sampdate: Date, format: "2007-12-12" "2007-12-12" ... $ preeq0 : logi TRUE TRUE TRUE TRUE TRUE TRUE ... $ param : Factor w/ 37 levels "Ag","Al","Alk_tot",..: 1 2 8 17 3 4 ... $ quant : num 0.005 0.106 1 231 231 0.011 0.001 0.002 0.001 100 ......
2011 Sep 13
1
ZOO: Learning to apply it to my data
...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/ 8 levels "As","Ca","Cl",..: 1 1 1 1 1 1 1 1 1 1 ... $ quant : num 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0 ... The numeric column ('x' in zoo, I believe) is...
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 .melt data frames: summary(jerritt.melt) site sampd...
2009 Jan 12
3
merge table rows (\multirow)
...on for the following weeks. Below, I am creating a PDF using Sweave, MikTex,R-2.8.1 and windows XP to show an example. \documentclass[11pt]{article} \usepackage{longtable,verbatim} \title{How to implement multirow with Sweave} \begin{document} \maketitle <<dataAnalysis.R,echo=FALSE>>= sampDat <- "Month, Week, Est.passage, Med.FL July 27 665 34 July 28 2,232 35 July 29 9,241 35 July 30 28,464 35 Aug 31 41,049 35 Aug 32 82,216 35 Aug 33 230,411 35 Aug 34 358,541 35 Sept 35 747,839 35 Sept 36...
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 157 208 338 285 260 240 ... $ Ca : num 100 88.4 63.4 123 78.2 103 265 213 178 166 ... $ DO : num 4.96 9.91 4.32 2.58 1.81 5.09...
2012 Jan 02
1
Creating ZOO Matrix from Data Frame
...is how to convert a data frame to a zoo matrix for irregular time series analyses. An example data frame is structured like this: str(burns.cast) 'data.frame': 256 obs. of 47 variables: $ site : Factor w/ 143 levels "BC-0.5","BC-1",..: 1 1 1 2 2 2 2 2 2 2 $ sampdate : Date, format: "1996-04-19" "1996-05-21" ... $ Ca : num 76.6 NA NA NA NA ... $ Cond : num 712 403 731 NA NA NA NA NA NA NA ... $ HCO3 : num 162 152 212 NA NA NA NA NA NA NA ... $ SO4 : num 175 57 194 NA NA NA NA NA NA NA ... $ TDS : num 4...
2012 Aug 07
3
NADA Package: Referencing Data Frame Columns
...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 8 variables: $ site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 1 1 ... $ sampdate: Date, format: "2007-12-12" "2007-12-12" ... $ era : Factor w/ 2 levels "Post","Pre": 1 1 1 1 1 1 1 1 1 1 ... $ param : Factor w/ 64 levels "AgDis","AgTot",..: 2 4 5 7 11 15 25 ... $ quant : num 1.30e-04 1.06e-01 2.31e+02 1...
2010 Sep 03
1
calculate monthly mean
Hello group Im trying to plot 3d with scatterplot packages, i got error say " length(color) must be equal length(x) or 1 " may data has dimensions (lon,lat,lev,time) ,the time in month i want to calculate the monthly mean for the time how can i make that , is there any function doing that Thanks a lot ##load rgl package library(rgl) library(fields) library(ncdf)
2012 Jul 03
2
NADA Data Frame Format: Wide or Long?
I have water chemistry data with censored values (i.e., those less than reporting levels) in a data frame with a narrow (i.e., database table) format. The structure is: $ site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 1 1 1 ... $ sampdate: Date, format: "2007-12-12" "2007-12-12" ... $ preeq0 : logi TRUE TRUE TRUE TRUE TRUE TRUE ... $ param : Factor w/ 37 levels "Ag","Al","Alk_tot",..: 1 2 8 17 3 4 9 ... $ quant : num 0.005 0.106 1 231 231 0.011 0.001 0.002 0.001 100 ......
2011 Oct 24
2
Syntax Help for xyplot()
...et 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" "1996-06-02" ... $ param : Factor w/ 7 levels "Ca","Cl","Cond",..: 6 7 3 6 3 3 3 3 3 3 $ quant : num 194 530 826 36 848 ... and a summary of it shows: summary(burns.tds.anal) site sampdate...
2011 Aug 31
1
Correct Syntax for subset.data.frame()
I want to create individual data.frames for each of the 8 param factors in chemdata. The syntax I tried (based on Teetor's book, page 132) and R's response are: > ars <- subset(chemdata, select=c(site,sampdate,param,quant), subset=(param = "As")) Error in subset.data.frame(chemdata, select = c(site, sampdate, param, : 'subset' must evaluate to logical I'm asking for columns of type factor, date, factor, and numeric. What have I done incorrectly here? Rich
2012 Jan 01
2
Lattice: Understanding How Points Connected by Lines
A data frame has one factor, one date, and one numeric column. When I plot these using the default pch of the open circle (first attachment), xyplot(TDS ~ sampdate | she.s, data = sheep.cast, main = 'TDS in Sheep Creek', ylab = 'Concentration (mg/L)', xlab = 'Time') I see the higher concentration points toward the right on several panels. But, when I change to using a line type (second attachment), xyplot(TDS ~ sampdate | she.s, dat...
2011 Oct 04
3
How to subset() from data frame using specific rows
I have a data frame called chemdata with this structure: > str(chemdata) 'data.frame': 14886 obs. of 4 variables: $ site : Factor w/ 148 levels "BC-0.5","BC-1",..: 104 145 126 115 114 128 124 2 3 3 ... $ sampdate: Date, format: "1996-12-27" "1996-08-22" ... $ param : Factor w/ 8 levels "As","Ca","Cl",..: 1 1 1 1 1 1 1 1 1 1 ... $ quant : num 0.06 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 ... I've looked in the R Cookbook and Dalgaard'...
2012 Aug 07
3
reshape2's dcast() Adds NAs to Data Frame
...se 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
2011 Sep 22
3
Bivariate Scatter Plots with Lattice
Data frame has this structure: '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/ 8 levels "As","Ca","Cl",..: 1 1 1 1 1 1 1 1 1 1 ... $ quant : num 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0 ... I want to create scatter plots of the concentrations...
2012 Jul 10
2
Understanding cenros Error
...nf in 'y' I would like to learn what I did incorrectly so I can avoid these errors in the future. The data frame structure is str(chem) 'data.frame': 120309 obs. of 8 variables: $ site : Factor w/ 65 levels ";Influent","D-1",..: 2 2 2 2 2 2 ... $ sampdate: Date, format: "2007-12-12" "2007-12-12" ... $ preeq0 : logi TRUE TRUE TRUE TRUE TRUE TRUE ... $ param : Factor w/ 37 levels "Ag","Al","Alk_tot",..: 1 2 8 17 3 9 ... $ quant : num 0 0.106 1 231 231 0.011 0 0.002 0 100 ... $ ceneq1 :...
2011 Aug 31
3
Scatter Plot Command Syntax Using Data.Frame Source
...kbook" without seeing how to write the command to create scatterplots from my data.frame. The structure is: > str(chemdata) 'data.frame': 14886 obs. of 4 variables: $ site : Factor w/ 148 levels "BC-0.5","BC-1",..: 104 145 126 115 114 128 124 2 3 3 ... $ sampdate: Date, format: "1996-12-27" "1996-08-22" ... $ param : Factor w/ 8 levels "As","Ca","Cl",..: 1 1 1 1 1 1 1 1 1 1 ... $ quant : num 0.06 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 ... and what I'd like to do is create scatter plot...
2012 Oct 23
1
Understanding lattice barchart() display
I've a data frame with this structure: 'data.frame': 1987 obs. of 11 variables: $ site : Factor w/ 24 levels "B(W)","BC-1",..: 1 1 2 2 2 1 1 1 ... $ sampdate : Date, format: "2000-07-18" "2000-07-18" ... $ tclass : Factor w/ 8 levels "Annelida","Arachnida",..: 1 5 5 5 5 ... $ torder : Factor w/ 18 levels "Achtinedida",..: 13 5 5 10 13 5 7 ... $ tfamily : Factor w/ 81 levels &q...