search for: midpt

Displaying 12 results from an estimated 12 matches for "midpt".

Did you mean: midpts
2002 May 19
3
How to shade part of a density plot
I'm trying to shade part of a density plot. The code I'm trying (using the Old Faithful data as an example) is something like this: # The Old Faithful geyser data data(faithful) d <- density(faithful$eruptions, bw = "sj") plot(d) polygon(d[d$x>4], col = "wheat") I expected that the part of the curve to the right of 4 on the x axis should be shaded, but nothing
2017 Dec 18
2
Finding center of mass in a hydrologic time series
...tartDate, EndDate) # Define 'center of mass' function com <- function(x) { match(TRUE, cumsum(x/sum(x)) > 0.5) - 1 } wyrs <- unique(Daily$waterYear) for(i in (1:length(wyrs))){ OneYr <- Daily[Daily$waterYear==wyrs[i], ] mid <- com(OneYr$Q) if(i==1){ midPts <- as.Date(OneYr$Date[mid]) } else { midPts <- c(midPts, as.Date(OneYr$Date[mid])) } } Eric Morway Research Hydrologist Nevada Water Science Center U.S. Geological Survey 2730 N. Deer Run Rd. Carson City, NV 89701 (775) 887-7668 *orcid*: 0000-0002-8553-6140 <http://orc...
2009 Aug 12
1
calling a function with dynamically generated buttons
...ynamically generating buttons depending on the number of rows of my dataframe. Every button is supposed to call a function which generates a plot with the values of one of my dataframe rows. My code looks like this: base <- tktoplevel() plotten <- function(mat, namen, titel) { midpts <- barplot(height=mat, names.arg = namen, main = titel, las=2) text(midpts, 1, mat) mtext(text=paste("Treshold:", thresh), side=3, col="blue") } lb <- tklabel(base, text="Barplot:") tkgrid(lb, row=4, column=0) for(i in 1:(reihe...
2017 Dec 18
0
Finding center of mass in a hydrologic time series
...function > com <- function(x) { > match(TRUE, cumsum(x/sum(x)) > 0.5) - 1 > } > > > wyrs <- unique(Daily$waterYear) > for(i in (1:length(wyrs))){ > OneYr <- Daily[Daily$waterYear==wyrs[i], ] > mid <- com(OneYr$Q) > if(i==1){ > midPts <- as.Date(OneYr$Date[mid]) > } else { > midPts <- c(midPts, as.Date(OneYr$Date[mid])) > } > } > > > > Eric Morway > Research Hydrologist > Nevada Water Science Center > U.S. Geological Survey > 2730 N. Deer Run Rd. > <https://maps.go...
2001 Apr 23
1
location of multi-line labels on barplots?
Hi, All. I have a barplot I am making that has a 2 line label: names(GC) <- c("Read-Off", "Spatial\n Transformations", "Vis Changes", "Plans", "Abandon") and here, Spatial Transformations should be on 2 separate lines. However, when I break it as above (with the \n), the "Spatial" part is pushed up so that it overlaps the Tick mark
2010 Jan 07
1
Barplot + plot same scale
Hello, I would like to plot : barplot(c(10,12,18)) and plot(c(0,2,3), t="l") and many other plots... in a same scale. With par(new=T) it's not align, points are not in the middle of the bar of barplot. Is there an easely solution to align that ? Thank for you help, G [[alternative HTML version deleted]]
2008 Feb 02
2
Confidence Interval
I have a model as follows: x <- replicate(100, sum(rlnorm(rpois(1,5), 0,1))) y <- quantile(x, 0.99)) How would one go about estimating the boundaries of a 95% confidence interval for y? Any pointers would be greatly appreciated. > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 5.1 year 2007 month 06 day 27 svn rev 42083 language R
2017 Dec 16
0
Finding center of mass in a hydrologic time series
Hi Eric, How about match( TRUE, cumsum(hyd/sum(hyd)) > .5 ) - 1 HTH, Eric On Sat, Dec 16, 2017 at 3:18 PM, Morway, Eric <emorway at usgs.gov> wrote: > The small bit of script below is an example of what I'm attempting to do - > find the day on which the 'center of mass' occurs. In case that is the > wrong term, I'd like to know the day that essentially cuts
2004 Jul 21
2
RE: Comparison of correlation coefficients - Details
Dear all I apologize for cross-posting, but first it is accepted custom to thank the repliers and give a summary, and second I have still the feeling that this problem might be a general statistical problem and not necessarily related to microarrays only, but I might be wrong. First, I want to thank Robert Gentleman, Mark Kimpel and Mark Reiners for their kind replies. Robert Gentleman kindly
2017 Dec 16
3
Finding center of mass in a hydrologic time series
The small bit of script below is an example of what I'm attempting to do - find the day on which the 'center of mass' occurs. In case that is the wrong term, I'd like to know the day that essentially cuts the area under the curve in to two equal parts: set.seed(4004) Date <- seq(as.Date('2000-09-01'), as.Date('2000-09-30'), by='day') hyd <-
2007 Jul 13
2
Question about acception rejection sampling - NOT R question
This is not related to R but I was hoping that someone could help me. I am reading the "Understanding the Metropolis Hastings Algorithm" paper from the American Statistician by Chip and Greenberg, 1995, Vol 49, No 4. Right at the beginning they explain the algorithm for basic acceptance rejection sampling in which you want to simulate a density from f(x) but it's not easy and you
2007 Aug 15
4
Possible to "import" histograms in R?
Hi, I have a large amount of data that I would like to create a histogram of and plot and do things with in R. It is pretty much impossible to read the data into R, so I have written a program to bin the data and now have a list of counts in each bin. Is it possible to somehow import this into R and use hist(), so I can, for instance, plot the probability density? I have looked at the help page