similar to: Binary Search

Displaying 20 results from an estimated 1000 matches similar to: "Binary Search"

2007 Aug 19
2
Does anyone else think this might be worth a warning?!?
Hi, I was *very* surprised by this little trick for new players: mean() only considers its first argument! > mean(1,1,2) [1] 1 > mean(2,1,1) [1] 2 I found this very different behaviour to max(): > max(1,1,2) [1] 2 > max(2,1,1) [1] 2 Perhaps this is the wrong list to ask, but does anyone else think this a little on the interesting side? Is it not possible to detect a
2007 Aug 31
2
Problem of vocabulary : retrieve element of a list of a list
Hi, I read the posts for 2 hours and ?list and tried many comninations but I haven't found the answer to this basic question. So I decided to post my question even if it is a silly one ... What is the instruction to retrieve, for example, the "D" of the first list ? Thanks in advance, Ptit Bleu. > x<-list(LETTERS[1:5], LETTERS[10:20]) > x [[1]] [1] "A"
2007 Aug 22
3
Help with vector gymnastics
Hello, What is the best way of solving this problem? answer <- ifelse(tf=TRUE, i * 5, previous answer) where as an initial condition tf[1] <- TRUE For example if, tf <- c(T,F,F,F,T,T,F) over i = 1 to 7 then the output of the function will be answer = 5 5 5 5 25 30 30 Thank you. Phil,
2008 Oct 19
3
pairs plots in R
Hi, is there a way to take a data frame with 100+ columns and large data set to do efficient exploratory analysis in R with pairs? I find using pairs on the whole matrix is slow and the resulting matrix is tiny. Also the variable of interest for me is a binary var Y or N . Is there an efficient way to graphically view many variable relationships that does not look teeny ? I could do
2008 Jul 24
1
plot.dendrogram xlim/ylim
list(...), I would like to zoom in to the leaves of large trees in a dendrogram plot. The playwith package allows zooming by passing xlim and ylim arguments to the plot call (Hmisc does this too I think). But currently stats:::plot.dendrogram does not accept xlim or ylim. So I would like to enable that. In place of the existing code chunk: xlim <- c(x1 - 1/2, x2 + 1/2) ylim <- c(0,
2007 Aug 16
1
time series with quality codes
list(...), I am working with environmental time series (eg rainfall, stream flow) that have attached quality codes for each data point. The quality codes have just a few factor levels, like "good", "suspect", "poor", "imputed". I use the quality codes in plots and summaries. They are carried through when a time series is aggregated to a longer time-step,
2007 Jul 25
1
how to use "replace" for efficiency
Hi I think I have been struggling to use replace correctly, I usually work my way around this using a loop, but I think this is in fact inefficient. I have a dataset with runoff from three plots and associated rainfall. However either the datarecording was sloppy, or the rainfall very patchy. So I am trying to remove data from my dataset for which the runoff is larger than the rainfall on the
2008 Jan 15
1
navigating ggplot viewports
list(...) I can not get at the grid viewports in a ggplot2 plot. I know there is supposed to be a viewport called "panel_1_1" but downViewport() can't find it. Has the viewport been popped? I had a quick look at the functions involved (eg ggplot_plot) but there is no obvious problem there. > library(ggplot2) > qplot(1:10, 1:10) > current.viewport() viewport[ROOT] >
2009 Jan 05
1
bug involving quote(); ghost in the machine
Hi list(...), I've narrowed down a weird bug. It's like a ghost in the machine, in that functions seem to remember things that they should not be able to. In the example below, the result of the second (and subseqent) calls depend on what was given in the first call. foo <- function(given = NULL) { callObj <- quote(callFunc()) if (!is.null(given)) callObj$given
2009 Mar 29
1
Lattice question.
Hi. I am trying to do histograms in lattice, and I want to get both counts and percents in the same plot. To try to be clearer --- there are 3 levels to my factor; I'd like to get a 2 x 3 array of plots where the top row consist of histograms by counts and the bottom consists of (the corresponding) histograms by percent. I tried the following: # Demo. library(lattice) set.seed(42) XX <-
2007 Aug 14
3
diffusing GIS data in maps
Hi- I am trying to find a way to diffuse GIS data on a European map. I have a dataset consisting of particular locations scattered across Europe, along with magnitude and value information. I can plot these as discrete points with something like the following: "geocode" is a dataframe with four columns: LAT; LONG; MAGNITUDE;VALUE. library(maps) library(mapdata)
2008 Jul 22
1
xyplot help
I have a question about xyplot. Suppose I want to plot say a response variable y vs a predictor x within groups defined by a variable called z. And suppose I have another variable v=1,2 with two levels. I would use the following command to get a "spaghetti plot" with two panels defined by v. xyplot(y~x|v,groups=z,type="l") My question is that on top of the panels, the title of
2008 Nov 17
1
Levelplot + Mosaic Plot hybrid?
Hi. I have built a levelplot with 3 variables, X, Y, and Z where X and Y are the two axes and Z represents the intensity (i.e. Z~X*Y). Now I want to adjust the size of the grid (like a mosaic plot) where the size of each grid is weighted by a variable, W. Just wonder how can I do that with levelplot? I tried exploring mosaic plot. How can I manipulate the "col" option to make it
2008 Jan 07
1
How to rearrange lattice graphics output?
My question arises when I use levelplot graphics. For example, levelplot(z~x*y|fg) where fg is a factor with three levels of 'a','b','c'. The panels come out in a default order. I would like to rearrange the panels in a manner of 'c','b','a'. I used fg<-ordered(fg, levels=c('c','b','a')) But the panels are still the
2008 Jul 27
1
Transfer Function Modeling
Hi, I would like to know how to build the transfer function modeling for bivariate time series data. I tried searching for relevant threads, but could not find much help with it. Thanks Ashish [[alternative HTML version deleted]]
2008 Oct 30
1
Plot Point Labelling
Hi, Please tell me of an R graphical routine that will create a 3d plot something like "cloud" or "scatterplot3d" but that allows individual labeling of each point in the plot. I've done it with SPSS. I'm sure that there is an R routine, but I can't find it. I'm at: charles.liard.vb@cmha.bc.ca cliard@hotmail.com Thanks! Charles Charles Liard CMHA
2008 Nov 04
1
problem with plot style (pch) with lattice in legend
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20081104/b667d8da/attachment.pl>
2008 Aug 05
2
graphical user interface
Hi there, I would like to design a graphical user interface to provide the functionality of my R-scripts to other users (not knowing anything about R...) Can anybody give me some hints which possibilities I have (advantages / disadvantages)? What do you use to build applications? Ciao, Antje
2008 Nov 20
1
Repost:lattice graphics -- legend color problems
Hello R-folks, I don't get the color of the legend in a lattice-plot right. I select a palette from RColorBrewer and use (with a col = mypalette argument) it in the barchart plot. The resulting graph shows the new palette in the graph, but uses the standard palette in the legend rectangles. Adding a col argument into auto.key uses the new palette with the legend text, but not in the
2008 Feb 11
2
RGTK2 and glade on Windows - GUI newbie
Hallo, I'd like to write a GUI (first choice with GTK+). I've surfed through the R- an Omegahat-Pages, because I'd like to use RGTK2, GTK 2.10.11 in combination with glade on Windows XP (perhaps later Unix, Mac). I've found a lot of different information. Because of the information I'm not sure, if this combination is running on Windows XP and I'm unsure how it works. Is