similar to: overlaying 2D grid on randomly distributed points

Displaying 20 results from an estimated 100 matches similar to: "overlaying 2D grid on randomly distributed points"

2012 Apr 19
4
Column(row)wise minimum and maximum
Hi, Currently, the "base" has colSums, colMeans. It seems that it would be useful to extend this to also include colMin, colMax (of course, rowMin and rowMax, as well) in order to facilitate faster computations for large vectors (compared to using apply). Has this been considered before? Please forgive me if this has already been discussed before. Thanks, Ravi Ravi Varadhan, Ph.D.
2012 Feb 02
4
The "less than" (<) operator doesnt seem to perform as expected
The example here puzzles me. It seems like the < operator doesn't work as expected. > l <- 0.6 > u <- seq(0.4, 0.7, 0.1) > u [1] 0.4 0.5 0.6 0.7 > mygrid <- expand.grid("l" = l, "u" = u) > mygrid l u 1 0.6 0.4 2 0.6 0.5 3 0.6 0.6 4 0.6 0.7 > mygridcollapsed <- mygrid[mygrid$l < mygrid$u, ] > mygridcollapsed l u 3 0.6 0.6 4
2013 Feb 03
1
Looping through rows of all elements of a list that has variable length
Dear R-ers, I have a list of data frames such that the length of the list is unknown in advance (it could be 1 or 2 or more). Each element of the list contains a data frame. I need to loop through all rows of the list element 1 AND (if applicable) of the list element 2 etc. and do something at each iteration. I am trying to figure out how to write a code that is generic, i.e., loops through the
2010 Sep 30
1
Can this code be written more efficiently?
Dear users, I'm working on binary classification problem using Support Vector Machines (SVM). My objective is to train a series of SVM models on a grid of hyperparameters and then select those that maximize the AUC based on an independent validation sample. My attempted code is shown below. It runs well on "small" data sets but when I use it on a slightly larger sample (e.g., my
2009 Feb 06
2
annotating a filled contours plot with a grid of points
Dear R-help members, I am trying to plot annotate a filled contours plot (with filled.contour) with a grid of points. I have read ways of annotating it with individual points but not with grids in another matrix. Any ideas? Thank you very much. Dario ___________________________________ Dario Martin-Benito CIFOR-INIA Dpto. Sistemas y Recursos
2009 Jan 21
1
finding row and column indices of date in multiple columns of a data frame
Hi, I have a data.frame SAMPLES with columns: Site Site# Season Day1 Day2 Day3 Day1, Day2, Day3 are class "Date", the other columns are numeric or factor. I have a date "mydate" that may or may not be listed in my data.frame and I need to find that out. If "mydate" is there, I want to get the number of the data.frame row where it occurs.
2007 Aug 17
4
matching elements from two vectors
Hi, Imagine a vector x with elements (1,2,1,1,3,5,3,3,1) and a vector y with elements (2,3). I need to find out what elements of x match any of the elements of y. Is there a simple command that will return a vector with elements (F,T,F,F,T,F,T,T,F). Ideally, I would like a solution that works with dataframe colums as well. I have tried x==y and it doesn't work. x==any(y) doesn't work
2008 Feb 10
2
View() + "End" key on Ubuntu=segfault
I can repeatably crash R (segfault) by doing n <- 10 z <- data.frame(a=1:n,b=1:n) View(z) and then hitting the "End" key on my keyboard. I haven't got debugging going yet, but running under gdb (without debugging symbols) does give this: 0xb7b63583 in strlen () from /lib/tls/i686/cmov/libc.so.6 R version 2.6.2 (2008-02-08) i486-pc-linux-gnu [Ubuntu Gutsy] locale:
2010 Aug 20
3
change object name within for loop
Hi, I am writing a for loop that creates one object, say 'outn' on every round of the loop. I would like the name of each object to include the index of the loop as in, for example: out1, out2, out3, ... And I would like the naming of the object to take place automatically as the loop moves through? Similarly, I would like to be able to call different objects (in1, in2, in3,
2007 Aug 21
2
extracting month from date in numeric form
Hi, Anyone knows what would be a short way of extracting a month from a date in numeric or integer format? months("1979-12-20") returns "December" in character format. How could I get 12 in numeric or integer format? Thanks! G. [[alternative HTML version deleted]]
2010 Nov 01
0
function: colvolve
Hi list, I have a problem to solve which I believe I shoudl use the convolve to solve it, but I could not figure out how to do it. I got mydata, which is a dataframe which has 7 locations, each location has a longitude,latitude and a value. considering a step of 0.5 degree for longitudes and latitudes, I got 15 points for longitude and 15 points for latitude. Then I created a grid, mygrid, which
2009 Sep 19
1
matrix operations on grobs and grid units
Dear list, As a minimal test of a more complex grid layout, I'm trying to find a clean and efficient way to arrange text grobs in a rectangular layout. The labels may be expressions, or text with a fontsize different of the default, which means that the cell sizes should probably be calculated using grobWidth() and grobHeight() as opposed to simpler stringWidth() and stringHeight().
2005 Jun 16
1
AIC in glm.fit with intercept
Dear R users, glm.fit() gave me the same AIC's regardless of TRUE or FALSE intercept option. > myX <- as.matrix(1:10) > myY <- 3+5*myX > foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=TRUE) > foo$aic [1] 38.94657 > foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=FALSE) > foo$aic [1]
2007 Apr 18
5
Problem with ?curve
Dear all R gurus, I have following syntax: y = c(1:10) chippy <- function(x) { y[5] = x sin(cos(t(y)%*%y)*exp(-t(y)%*%y/2)) } curve(chippy, 1, 20, n=200) But I am getting error while executing : Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ In addition: Warning message: number of items to
2017 Mar 28
2
A trap for young players with the lapply() function.
On 28/03/17 15:26, Charles C. Berry wrote: > On Mon, 27 Mar 2017, Rolf Turner wrote: > >> >> From time to time I get myself into a state of bewilderment when using >> apply() by calling it with FUN equal to a function which has an >> "optional" argument named "X". >> >> E.g. >> >> xxx <-
2013 Mar 12
0
Knn by using R
Dear useRs, I have a matrix which contains population data at 12 points of every station. In total there are 179 stations. So, its a matrix of 179 columns and 12 rows. Through a self inventory distance calculation method, a distance matrix was prepared for this data. Now i want to do k-nearest neighborhood classification by considering all the nearest neighbors of each station. i tried the
2005 Nov 16
1
RODBC and Very long field lengths
I'm having a small problem using RODBC. I'm trying to retrieve a string from a very long memo field (512*20*9=9360 characters = 74880 bytes) in an MSAccess database. It appears that RODBC set a maximum buffer size for a single column of 65535 bytes. ########## cut from RODBC.c ########## } else { /* transfer as character */ int datalen = thisHandle->ColData[i].ColSize; if
2007 Aug 30
5
Single plot multiple levels in x?
Plotting with 2 x axis? One axis inside another, for example salary within state, 1-50 | 50 ? 100 | 100+ | 1- 50 | 50 -100 | 100+ | ? repeated bins for salary AL ! AR ?? more states The values are all stored with a single data frame. I have tried different things with the axis function and done many
2010 Jan 27
1
control of scat1d tick color in plot.Predict?
Hi All, I have a quick question about using plot.Predict now that the rms package uses lattice. I'd like to add tick marks along the regression line, which is given by data=llist(variablename) in the plot call. The ticks show up fine, but I'd like to alter the color. I know the ticks are produced by scat1d, but after spending a fair bit of time going through documentation, it still
2008 Jan 31
1
decrease amount of ticks on y axis in lattice levelplot
Hi all, How can I decrease the number of ticks on the y-axis in a lattice levelplot()? I have as many ticks displayed on the y-axis as I have columns of data (1000 columns), how can I decrease this amount of ticks, while still properly displaying all the data? Note that I get my data from a matrix object, in which the z-values of the levelplot are the actual values in the matrix, whereas the