search for: midpoints

Displaying 20 results from an estimated 192 matches for "midpoints".

Did you mean: midpoint
2009 Nov 08
3
Obtaining midpoints of class intervals produced by cut and table
Hello list: I am using "cut" and "table" to obtain a frequency table from a numeric sample vector.  The idea is to calculate mean and standard deviation on grouped data.  However, I can't extract the midpoints of the class intervals, which seem to be strings treated as factors.  How do i extract the midpoint? Thanks, jose loreto [[alternative HTML version deleted]]
2009 Jun 26
1
predicted values after fitting gamma2 function
Question: after fitting a gamma function to some data, how do I get predicted values? I'm a SAS programmer, I new R, and am having problems getting my brain to function with the concept of "object as class ...". The following is specifics of what I am doing: I'm trying to determine the pdf from data I have created in a simulation. I have generated frequency counts
1999 Nov 13
1
image()
May I raise the issue of the behaviour of image()? In image() dim(z) is supposed to be c(length(x), length(y)). This suggests that the user is supplying the midpoints of the rectangles. For all but the outer rectangles this is true. The outer rectangles, however, are only displayed in half width. So it is not possible to show correctly an image plot of equally-spaced abscissa. I would hazard a guess that these kinds of plots make up the bulk of calls to imag...
2005 Nov 02
1
x/y coordinates of dendrogram branches
...own (the heights of the agglomeration), but how can I get the x-values? > mydata <- c(1,2,3,4,5) > hc <- hclust(dist(mydata), method="average") > hc$height # these are the y-coordinates [1] 1.0 1.0 1.5 2.5 I experimented with the dendrogram object because it gives the midpoints: > dend <- as.dendrogram(hc) > attributes(dend[[1]])$midpoint [1] 0.5 Perhaps I could loop over all possible branches and get the midpoints if I knew how to convert them to x-values. The manual says that midpoint is the "numeric horizontal distance of the node from the left bord...
2012 May 23
3
applying cbind (or any function) across all components in a list
#If I have two lists as follows a1<- array(1:6, dim=c(2,3)) a2<- array(7:12, dim=c(2,3)) l1<- list(a1,a2) a3<- array(1:4, dim=c(2,2)) a4<- array(5:8, dim=c(2,2)) l2<- list(a3,a4) #how can I create a new list with the mean across all arrays within the list, so all components are included? As an example for [[1]]; cbind((l1[[1]][,1]+l2[[1]][,1])/2,
2010 Jul 23
1
Midpoint between coordinates
Dear R users, I need to find the coordinates for the point (midpoint) located half way between two pairs of coordinates (lon1,lat1 and lon2,lat2) assuming a straight line between them. What would be the best way? I tried to find an answer in the help archives but without success. I would greatly appreciate any help. df<- data.frame(lon1=c(-4.568,-4.3980), lat1=c(59.235,56.369),
2008 Jan 28
1
Grouping data via an index
...ion of the midpoint of that group in the index vector. For example, 4 or 5 would become a 2; 6 would become 3; 9 or 10 would become 4, and so on. Haven't had any success thus far -- does anyone know of a simple method offhand? I've started by converting the data vector to a vector of the midpoints of each group, via > round(data.vector/3)*3 + 1 But haven't been able to accomplish much past that. I'm guessing it can be accomplished via a simple loop or otherwise. Thanks, -- jared tobin, student research assistant fisheries and oceans canada tobinjr at dfo-mpo.gc.ca
2007 Mar 20
2
Problem adjusting x-labels with bargraphCI
Hello: I'm having quite a bit of difficulty adjusting the x-labels using bargraphCI. I've tried using text and srt=45 to rotate the labels or mtext for 2 lines to break up the labels. However, using either method, I cannot line up the labels with the midpoints of the bars (they line up with some sort of tick mark that is off the midpoint of the bars). Any suggestions would be greatly appreciated. Regards Pedro L. Vera, Ph.D. University of South Florida, Dept of Surgery [[alternative HTML version deleted]]
2009 Dec 01
2
Cut intervals (character) to numeric midpoint; regex problem
Starting with the head of a 499 element matrix whose column names are now the labels trom a cut() operation, I needed to get to a vector of midpoints to serve as the basis for plotting a calibration curve ( exp(linear predictor) vs. : > dput(head(dimnames(mtcal)[2][[1]])) # was starting point testvec <- c("(-8.616,-3.084]", "(-3.084,-2.876]", "(-2.876,-2.756]", "(-2.756,-2.668]", "(-2.6...
2002 Aug 06
1
Questions about lexical scope
Dear R-users, The numerical integration example given in Gentleman and Ihaka (2000), "Lexical Scope and Statistical Computing," JCGS, 9, 491-508, is very interesting and helpful in understanding how lexical scope is about. However, I got some questions that I just can't figure out. First all, allow me to copy the two functions given by the authors: midpoint <- function(f, a,
2005 Aug 22
2
problem building dendrograms to use with heatmap()
Hi, I'm trying to build dendrograms to pass to heatmap(). The dendrograms I build plot properly, but when I pass them to heatmap() I get the error message "row dendrogram ordering gave index of wrong length" (see output log below). I looked in the code of heatmap() and saw that the error was due to a NULL return value from order.dendrogram(), which in turn got a NULL return value
2009 Jun 01
3
exporting data to csv file -problem with column names
I have a data.frame with three columns + the row number Sample MidPoint Count [1,] 1 0.025 1 [2,] 1 0.075 3 [3,] 1 0.125 15 [4,] 1 0.175 12 [5,] 1 0.225 5 [6,] 1 0.275 8 When I export the data to a csv the column names are shifted because the row numbers are being exported as well. Sample MidPoint
2011 Mar 08
4
minimum distance between line segments
...ce between line segments. For instance, consider 20 random line segments: x1 <- runif(20) y1 <- runif(20) x2 <- runif(20) y2 <- runif(20) plot(x1, y1, type = "n") segments(x1, y1, x2, y2) Inititally I thought the solution to this problem was to work out the distance between midpoints (it quickly became apparent that this is totally wrong when looking at the plot). So, I thought that perhaps finding the minimum distance between each of the lines endpoints AND their midpoints would be a good proxy for this, so I set up a loop that uses pythagoras to work out these 9 distances and...
2003 Feb 03
4
Overlaying a moving average curve on top of a barplot
I''m using standard barplot (Windows version 1.6.2 of R) to represent a certain weekly metric "v" and I would like to properly overlay on top of it its moving average "mean.8" (window of 8 weeks). I must be doing something wrong since the moving average (using "lines") doesn''t overlay properly, i.e., both x-scales do not match! ...
2009 Jun 05
2
p-values from VGAM function vglm
Anyone know how to get p-values for the t-values from the coefficients produced in vglm? Attached is the code and output ? see comment added to output to show where I need p-values + print(paste("********** Using VGAM function gamma2 **********")) + modl2<- vglm(MidPoint~Count,gamma2,data=modl.subset,trace=TRUE,crit="c") + print(coef(modl2,matrix=TRUE))
2012 Dec 16
1
average X value of specific Y
Hello I have a table describing butterfly range traits. It is composed of three columns as below Species name range size (X) latitude of range midpoint (Y) There are 11 kinds of butterflies. Each has its range size, and the latitude of each range midpoint ranges from 9 to 19. I would like to have the average range size of every degree of latitude. For example, the average range
2011 Dec 01
3
[LLVMdev] anchoring explicit template instantiations
On Wed, Nov 30, 2011 at 10:42 PM, Chris Lattner <clattner at apple.com> wrote: > On Nov 29, 2011, at 12:26 AM, David Blaikie wrote: >> For a bit of an experiment I've been trying to compile LLVM & Clang >> with -Weverything (disabling any errors that seem like more noise/less >> interesting). One warning I've recently hit a few instances of is >>
2008 May 29
3
Manipulating DataSets
Hello R-Users, I am new to R and trying my best however I need help with this simple task. I have a dataset, YM1207. X.Symbol Date Time Exchange TickType ReferenceNumber Price Size 12491 3:YMZ7.EC 12/03/2007 08:32:50 EC B 85985770 13379 7 12492 3:YMZ7.EC 12/03/2007 08:32:50 EC A 85985771 13380 4 12493
2018 Nov 14
2
Los puntos no tapen el mapa hecho ggplot
Buenos días. Hago mis mapas con el código que os copio abajo, pero me gustaría que me dibujase las líneas del mapa después de poner los puntos para que se vean. Puedo hacer los puntos más pequeños, pero entonces quedan separados y yo quiero que rellenen el mapa. Gracias, como siempre, Manuel print(ggplot(legend=FALSE)+geom_path(data=map_data('world'), aes(x=long,
2003 Jul 11
1
3d plot with different levels done in different colors
I would like a 3d plot of a matrix such that individual trapezoids that make up the surface are colored according to the z-value of that point (or preferably the midpoint of its four corners, or something similar). MS Excel has something like that. I know that persp can have an nx by ny matrix its "col" argument, I just don't know how to generate that matrix. To calculate the