[R] Read multiple files into dataframe?

2009-09-01 Thread Douglas M. Hultstrand
005.00 7.32,010.00 6.91,020.00 5.90,050.00 5.02,100.00 4.09,200.00 3.55,300.00 2.96,500.00 2.27,0001000.00 1.64,0002000.00 0.82,0005000.00 0.77,0005360.00 -- ----- Douglas M. Hultstrand,

[R] Linear Model "NA" Value Test

2009-09-21 Thread Douglas M. Hultstrand
rmula = y ~ x) Coefficients: (Intercept)x 1 NA coef <- coef(fit) fit$coef[[2]] [1] NA if("fit$coef[[2]]" == "NA") {.cw = 1} -- --------- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 e

[R] Plot nls line on plot?

2009-10-08 Thread Douglas M. Hultstrand
- c(1,10,15,20,25,30,35,40,45,50,55,60) p <- c(.02,.08,.2,.45,1.03,2.36,5.37,12.24,27.85,63.39,144.27,328.35) cnt <- length(z) fit <- nls(p~(b*exp(m*z)), start=list(m=.1645,b=.017), control=list(maxiter=200)) plot(p~z) # want to add fit/line to plot Thanks, Doug -- -------

[R] Data frame search and remove questions

2009-10-15 Thread Douglas M. Hultstrand
1.000 5 -999.000 938.71 -93.16 1.016 320 3.717 10 38.95 -95.67 1.000 5 8.553 > d.new lat.add lon.add PPT.add Z.add sd_dif 137.08 -95.57 0.508 106 -999.000 238.85 -94.73 1.000 5 -999.000 Thanks for all the help, Doug -- ----------

[R] Singular Gradient Test

2009-10-19 Thread Douglas M. Hultstrand
ood) {proceed model coefficients} else {use default coefficients}? Thanks for all your help, Doug -- ----- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: dmhul...@metstat.com web: http://www.metstat.

[R] Cairo package, png files within for loop are black?

2009-10-22 Thread Douglas M. Hultstrand
groups=dur, main=(t.n), ylab=expression("Area(mi" ^ 2 * ")"), xlab="Maximum Average Depth of Percipitation (inches)", scales=list(y=list(log=TRUE)), ylim=c(1,100), type='l', auto.key=list(space='right')) dev.off() -- --

[R] New vector based on if/else statement within for loop?

2009-10-27 Thread Douglas M. Hultstrand
- data.frame(Z,P,w) d.f Z P w 1 25 0 0 2 23 1 1 3 28 2 2 4 29 3 3 5 30 4 4 6 31 5 5 7 28 0 0 8 29 1 1 9 22 5 77 -- ------------- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: dmhul...@metstat

[R] data frame subsets?

2009-11-12 Thread Douglas M. Hultstrand
d$t < 2.0,] Thanks, Doug -- ------------- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: dmhul...@metstat.com web: http://www.metstat.com __ R-help@r-project.org mail

[R] lmomco package and confidence limits?

2009-11-16 Thread Douglas M. Hultstrand
parameters to fill-in the table below? Xi (location) = 35.396 Alpha (scale) = 1.726 Kappa (shape) = 0.397 Year, Return value, CI_u, CL_l 2, 36.0, 5, 37.3, 10, 38.0, 25, 38.5, 50, 38.8, 100, 39.0, Thank you for your help/suggestions, Doug -- - Douglas M

[R] paste name in for loop?

2009-11-30 Thread Douglas M. Hultstrand
100,0.011 22,1,0.003 22,5,0.005 22,10,0.00824 22,25,0.04258 22,50,0.057 22,100,0.101 23,1,2.10328 23,5,2.02755 23,10,1.93808 23,25,1.78408 23,50,1.67407 23,100,1.568 24,1,3.20842 24,5,3.09228 24,10,2.95452 24,25,2.71661 24,50,2.54607 24,100,2.38108 --

[R] Cairo Package Installation

2009-06-09 Thread Douglas M. Hultstrand
packages("Cairo") : installation of package 'Cairo' had non-zero exit status > Thanks, Doug -- - Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: dmhul...@metstat.com web: http://www.metstat.com __

[R] Display Equation on plot

2009-03-24 Thread Douglas M. Hultstrand
I want to display equation on a plot as y=0.4856x+48.54 Any thoughts or suggestions are appreciated. Thanks, Doug -- ----- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: dmhul...@metstat.com web: h

[R] R matching lat/lon pairs from two datasets?

2010-01-04 Thread Douglas M. Hultstrand
als loc2 freq_ppt <- c(data[i,4],data[i,6],data[i,8],data[i,10],data[i,12],data[i,14],data[i,16],data[i,18],data[i,20],data[i,22]) print(freq_ppt) return_value <- approx(freq_ppt,yrs,xout=data2[i,3]) print(return_value) } Thanks for your help, Doug -- ---

[R] Plot frame border to start at zero?

2010-01-19 Thread Douglas M. Hultstrand
# max accum location mtext(paste("Lat:", .lat, "Lon:", .lon), cex=0.95) mtext("Index Hour", side=1, line=2) mtext("Incremental Precipitation (in)", side=2, line=2.5) mtext("Accumulated Precipitation (in)", si

[R] Legend symbol?

2010-02-04 Thread Douglas M. Hultstrand
lt","Exponential (used)") } else { leg.txt <- c("Data", "Statistical Outlier", "Spatial Outlier", "High Z Outlier", "Default (used)","Exponential") } legend("topleft", legend=leg.txt, col=c("bla

[R] Netcdf and Raster Package Questions, Need .asc File for GIS

2013-01-29 Thread Douglas M. Hultstrand
iteRaster(r,file="test_grid2.asc", format="ascii") # need square grids # resample to square grids r2 = raster(r) res(r2) = min(res(r)) res(r2) r2 <- resample(r, r2, method='bilinear') writeRaster(r2,file="test_grid24.asc", format="ascii&qu

[R] Legend text populated with calculated values and super script?

2014-02-07 Thread Douglas M. Hultstrand
, type="p", col="green4",pch=3) leg.txt <- c(spas_leg, wdt_leg) legend("topleft", legend = leg.txt, col=c("red1","green4"), pch=c(1,3), cex=0.85) Any help/suggestions on this would be great. Thanks for your time in advance. Doug -- ---

Re: [R] Legend text populated with calculated values and super script?

2014-02-10 Thread Douglas M. Hultstrand
uot;)")) plot(x,y, col="red1", pch=1); lines(x,z, type="p", col="green4",pch=3) legend("topleft", legend = as.expression(c(sleg, wleg)), col=c("red1","green4"), pch=c(1,3), cex=0.85) Dennis On Fri, Feb 7, 2014 at

[R] Times series data file?

2010-06-14 Thread Douglas M. Hultstrand
thoughts would be very helpful. # Read in data file data <- read.table("file.txt", skip=4, header=F) temp <- data$V4 elev <- data$V3 Thank you, Doug -- ------------- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 720.77

[R] Unique Data Frame Name?

2010-06-23 Thread Douglas M. Hultstrand
appreciated. Thanks, Doug # Example for (i in 1:2) { x=c(1,2,3,4) y=c(10,20,30,40) G <- paste("name", i, sep="") G[i] <- data.frame(x,y) } -- --------- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, In

[R] data frame row statistics (mean)?

2010-06-28 Thread Douglas M. Hultstrand
4 4 7 7 8 6.50 -- - Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 720.771.5840 email: dmhul...@metstat.com web: http://www.metstat.com __ R-help@r-project.org mailing list

[R] R for loop question

2008-05-20 Thread Douglas M. Hultstrand
? k = 1 for (i in 1:length(stats$hour)) { "x(i)" = dataset[k,(3:15)] k = k+1 } Thanks, Doug -- ----- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: [EMAIL PROTECTED] web: http://www.m

[R] Save a function existing library

2008-10-30 Thread Douglas M. Hultstrand
-- - Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: [EMAIL PROTECTED] web: http://www.metstat.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Save a function existing library

2008-10-30 Thread Douglas M. Hultstrand
urce("C:/temp/functions/myfunction.txt") myfunction(2,3) which result, of course, would be 8. Another option is to save your function in the file "..\etc\Rprofile.site" as Xiaoxu LI suggested before. HTH, Jorge On Thu, Oct 30, 2008 at 1:45 PM, Douglas M. Hultstrand <[