Displaying 20 results from an estimated 1100 matches similar to: "AW: Rank and extract data from a series"
2003 Sep 23
0
Rank and extract data from a series
Here's one way.  Suppose your "time series" is in a vector called "x".
top10 <- sort(x, decreasing=TRUE)[1:10]
mean.index <- mean(which(x %in% top10))
HTH,
Andy
> -----Original Message-----
> From: James Brown [mailto:jdb33 at hermes.cam.ac.uk] 
> Sent: Tuesday, September 23, 2003 7:51 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Rank and
2006 Mar 27
2
A plotting question - how to get error bars?
Dear R list,
Can anyone help with a plotting question? I'm trying to display some data
on a plot and I've almost got the format I need (see code below), but 2
things I can't get:
1. How to get "Jan","Feb","Mar" on the x=axis instead of 1:3?
2. How to get "T"s on the end of my error bars like you have in standard
scientific plots?
Any comments
2013 Nov 27
1
Conditional error bars
How can I condition any error bar function that use the arrows() function,
such as 'CI.plot' (see example below) or 'error.bars', to draw only upper
error bar (upper CI) if the bar value (mean) is positive and the lower
error bar (lower CI) if bar value is negative?
CI.plot <- function(mean, se,length, ylim=c(-5, max(CI.H)), ...) {
    CI.H <- mean+se
    CI.L <- mean-se
2007 Oct 23
1
How to avoid the NaN errors in dnbinom?
Hi, The code below is giving me this error message:
Error in while (err > eps) { : missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In dnbinom(x, size, prob, log) : NaNs produced
2: In dnbinom(x, size, prob, log) : NaNs produced
I know from the help files that for dnbinom "Invalid size or prob will
result in return value NaN, with a warning", but I am not able
2000 Dec 15
1
resolution of windows metafiles
I am having trouble getting smooth-appearing curves in figures produced as
windows metafiles using R (R-1.1.1 on Windows 98).  When I import them into
a word processor (either MS Word 97, or WordPerfect 9.0), the figures
appear only slightly bumpy on screen, but when printed, there is a clear
jaggedness reminiscent of aliasing.  Is there a fix for this (if the answer
is "upgrade to 1.2",
2003 Jul 12
2
help with bivariate density plot question
Dear R users:
I have a dataset with two variables (>20000 observations, two samples from same subject) and I used "kernSur" from library(Genkern) to 
get a estimated bivariate density and corresponding plots as follows:
new.data.normal<-data.normal[!is.na(data.normal[,2]),]
x<-new.data.normal[,2]
y<-new.data.normal[,3]
op <- KernSur(x,y, xgridsize=50, ygridsize=50,
2005 Jul 28
2
problem with an IF statement?
Can somebody please take a look at this and tell me whats going wrong?
It seems to be parsing wronly around the 'if' statement and gives me a
directory listing.
Thanks in advance
Tom
N.B. datan is an invented dataset
xvals<-c(1,0.4,0.2)
datan<-data.frame(s1=c(3,4,5),s2=c(5,5,5),s3=c(21,55,34),s4=c(5,3,2))
datan$sint<-NA
datan$sgrad<-NA
for(icount in 1:dim(datan)[1]) {
2011 Jun 21
2
par code help
I am making a barplot using barplot2 from gplots where each bar  
represents a specific tree species. I have formatted the species names  
on the x-axis so that the genus name is above the species name and  
have then rotated the labels 45 degrees to save room. This is my code:
 >columncolor<-c("grey20", "grey20", "grey20", "grey70",
2010 Sep 29
2
R crashes when loading rgl package before minqa package
Hej,
Calling newuoa (from the minqa package) makes R crash when the package rgl 
is loaded first. This however only on certain selected data.
The data used for testing (saved to 'bugs.R'):
xvals = c(1,2,4,5,7,8,9,10,11,12,14,15,16,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36)
yvals =
2008 Aug 20
3
Confidence Interval
Hi!
With the following script, I'm trying to make a demonstration of a
Confidence Interval, but I'm observing some differences on tails.
# Teste de média entre uma amostra e uma população normal
# Autor: Raphael de Freitas Saldanha
# Agosto de 2008
n    <- 200    # Sample size
xbar <- 100    # Sample mean
s    <- 2      # Sample SD
nc   <- 0.95   # Confidence level (95%
2010 Mar 20
2
different forms of nls recommendations
Hello, 
Using this data:
http://n4.nabble.com/file/n1676330/US_Final_Values.txt US_Final_Values.txt 
and the following code i got the image at the end of this message:
US.final.values<-read.table("c:/tmp/US_Final_Values.txt",header=T,sep=" ")
US.nls.1<-nls(US.final.values$ECe~a*US.final.values$WTD^b+c,data=US.final.values,start=list(a=2.75,b=-0.95,c=0.731),trace=TRUE)
2011 Jan 20
1
Scale of 2nd y-axis
Dear list,
My query follows on from a question I posted a few days ago. I have the following 2 sets of data:
wetMeans[1] 9.904762[2] 6.344828[3] 6.346154[4] 6.855769[5] 9.074324[6] 9.953988[7] 13.482966[8] 14.546053[9] 10.841584[10] 9.752033[11] 6.739336[12] 8.955056burnMeans[1] 0.06214286[2] 0.05396552[3] 0.04096154[4] 0.05302885[5] 0.05831081[6] 0.07392638[7] 0.29969940[8] 0.25596217[9]
2009 Nov 16
1
No Visible Binding for global variable
While building a package, I see the following:
* checking R code for possible problems ... NOTE
cheat.fit: no visible binding for global variable 'Zobs'
plot.jml: no visible binding for global variable 'Var1'
I see the issue has come up before, but I'm having a hard time discerning how solutions applied elsewhere would apply here. The entire code for both functions is below,
2001 Feb 12
1
3d plots?
Hi all
I'm trying to create a three-dimensional wireframe-type plot,
much like the screenshot shown at
http://www.r-project.org/screenshots/volcano-persp.jpg
In my case, I'm trying to show a density estimate of
two-variable system, using the GenKern package.  I've
used the image() and contour() to create a nice shaded plot,
but I've found a 3d plot is often easier for the
2011 Jan 18
2
Barplot and line x-axis positions
Hello all,
Hoping that there is a fairly simple solution to my query...
I'm trying to overlay a line plot of some data onto a barplot of different data. The y-axes are different for each set of data but the x-axes are the same (1:12, corresponding with 12 months of observations). The problem I'm having is that the centre of the bars and the points on line don't match up, which is
2017 Aug 14
2
ncdf4: Why are NAs converted to _FillValue when saving?
Dear all
I'm a newbie regarding netcdf data. Today I realized that I maybe do not understand some basics of the netcdf. I want to create a *.nc file containing three variables for Switzerland. All data outside of the country are NAs. The third variable is calculated from the first two variables. Basically there is no problem to do that. I copy the file with the data of the first variable,
2008 Oct 20
2
R Newbie Question
Hello list,
I just started R today and tried something quite simple. I wanted to
create a colored plot and eventually after hours of fiddling around got
it working. However, my solution seems very suboptimal and I'd really
appreciate your hints on how to improve. I believe that R already offers
many functions I coded (e.g. distance between two vectors, vector
length, vector normalization and
2011 Jul 26
1
adjusting x-axis labels
I am trying to tweak how my categorical x-axis labels are formatted in  
my bar graph. Specifically, I would like to a) decrease the spacing  
between lines (e.g. spacing between Dialium and guianensis)  b) right  
justify the text and c) have each species name align with the center  
of the corresponding bar graph.
A simplified version of my code thus far is as follows. I am using  
RStudio v.
2006 Oct 16
2
set linetype with plotCI
Dear R-list,
I'm iterating several calls to plotCI [gplots], like so:
plotCI(
	x = xvals.f[sorted],
	y = yvals.f[sorted],
	xlim = c(xmin, xmax), ylim = c(ymin, ymax),
	pch = plot_symbols[graph_idx], type = "b",
        lty = plot_linetypes[1],
	col = plot_colors[graph_idx], 
        barcol = plot_colors[graph_idx], uiw = NA,
	xlab = "", ylab = "",
	add =
2017 Aug 14
0
ncdf4: Why are NAs converted to _FillValue when saving?
On Mon, Aug 14, 2017 at 5:29 AM, <raphael.felber at agroscope.admin.ch> wrote:
Dear all
>
> I'm a newbie regarding netcdf data. Today I realized that I maybe do not
> understand some basics of the netcdf. I want to create a *.nc file
> containing three variables for Switzerland. All data outside of the country
> are NAs. The third variable is calculated from the first two