Displaying 20 results from an estimated 645 matches for "coords".
2009 Feb 16
1
Help with rgl
Hi,
I don't know much about the RGL package, and I have read the
documentation and tried some parameters, with no luck... I would like
to generate a movie from a 3D object (code below), where the vortex A
is closer to the observer, and then the object rotates and the B
vortex gets closer. I would like to capture this movie to a file.
By the way, I am not being able to insert unicode text
2011 Jan 11
0
modified FAST Script from package SensoMineR for the R community - Reg
###Dear R users
###I have been using SensoMineR package from CRAN for most of my work in
sensory data analysis and from my usage experience, I encountered some
areas for improvement and considered ###modifying the function in
SensoMineR package for my personal use. I felt that it could be useful to
share this to the community for enabling adoption by other users where
they might require a
2003 Apr 28
2
sum(..., na.rm=TRUE) oddity
...I've had no luck searching the mail archives, so I was hoping somebody
could explain/check this one for me. I will need to apply the function
to missing data, simple as it is.
Code:
x<-matrix(runif(20,0,5)%/%1,4,5) # random matrix data set 4x5,
values are integers between 0 and 4
coords<-c(2,3,3,4) # choose any sub-matrix, with
c(ymin,ymax,xmin,xmax) being row and column indices.
occupied.counter<-function(coords){sum(x[coords[3]:coords[4],coords[1]:coords[2]])}
occupied.counter(coords)
[1] 7
occupied.counter<-function(coords){sum(x[coords[3]:coords[4],coords[1...
2005 Dec 19
1
How to draw partial grid in plot for spatial-binomial experiment?
...lly appear in the middle of the square cell.
I know there is the 'grid' package but it seems the plots made using 'graphics'
are not compatible with the plots made using 'grid' (as warned in the grid help
pages). Thanks in advance.
Ruben
"fri"<-structure(list(
coords=structure(c(606,606,608,608,608,608,608,610,610,610,610,610,610,610,612,612,612,612,612,612,614,614,
614,614,614,614,614,614,614,616,616,616,616,616,616,616,618,618,618,618,618,620,620,620,622,624,
4388,4390,4384,4386,4388,4390,4392,4380,4382,4384,4386,4388,4390,4392,4380,4382,4384,4386,4388,4390,4...
2007 Apr 03
1
which points within an ellipsoid? Sorting data in 3d
...z.data > z.coord.point - multipl
)
But now I have many more coordinate sets to compare my data to. How
can I find out in an efficient way which of the data points lie
within the ellipsoid?
Thanks!
Kim
#mock-data for the display with rgl
data.1 <- xyz.coords(5,-2,17)
data.2 <- xyz.coords(15, -10,18)
data.3 <- xyz.coords(-19, 13,9)
#code I use to construct the ellipsoid
x.coord.point <- 4
y.coord.point <- -7
z.coord.point <- -3
radius <- 8
x.radius.multiplier <- 1
y.radius.multiplier <- 2
z.radius.multiplier <- 3
endpoint &...
2009 Mar 10
1
North Arrow (.png file) on a Map
Hi list.
I would like to know how do I insert a North arrow, stored as a png file in
my computer, in a map? I found lots of post asking similar things, one of
them mentioned the pixmap package. The map was done using map() and
shapefiles (the code is below). I’m using the pixmap () and addlogo()
functions. Well I can import the png with pixmap() function (I guess, once
there’s no error message),
2006 Apr 13
2
a question on subset a dataset
Dear R-users,
I generate a dataset "d", and want to get a subset from it.
**
*z<-rnorm(9)
coords<-cbind(x=c(1,1,1,2,2,2,3,3,3),y=c(1,2,3,1,2,3,1,2,3))
d<-SpatialPointsDataFrame(coords, data.frame (z=z[1:9]))*
The result*/dataset* is
coordinates z
1 (1, 1) 1.41173570
2 (1, 2) 0.18546503
3 (1, 3) -0.04369144
4 (2, 1) -0.21591338
5 (2, 2) 1.46377535
6...
2013 Jan 29
1
points rejected as lying outside the specified window
...individuals of variable_type=0 are spatially distributed more than what would be expected due to chance, and finally if the spatial distribution of variable_type=1 differs from that of variable_type=0.
x<-NYBorough at polygons[[1]]@Polygons
# ppp(x.coordinates, y.coordinates, x.range, y.range)
coords<-slot(x[[1]],"coords")
coords
coords<-coords[19:1,]
coords<-coords[-1,]
coords
u<-myfile$type==0
Type_0<-ppp(myfile$X[u],myfile$Y[u],
window=owin(poly=list(x=coords[,1],y=coords[,2])))
Type_1<-ppp(myfile$X[!u],myfile$Y[!u],
window=owin(p...
2012 Jun 04
1
Plotting with Rgraphviz
...cted edges
Number of Nodes = 6
Number of Edges = 9
> plot(am.graph, attrs = list(node = list(fillcolor = "lightblue"),
+ edge = list(arrowsize=0.5)))
There were 18 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In plot.xy(xy.coords(x, y), type = type, ...) :
"len" is not a graphical parameter
2: In plot.xy(xy.coords(x, y), type = type, ...) :
"edgemode" is not a graphical parameter
3: In plot.xy(xy.coords(x, y), type = type, ...) :
"len" is not a graphical parameter
4: In plot.xy(xy.coords(...
2006 Jan 21
1
Bug in xy.coords() or documentation error?
Hi,
I noticed the following problem with xy.coords() in R 2.2.1-patched
(version info at the foot of this email) and R 2.3.0 unstable
(subversion no: r37123):
> xy.coords(x = matrix(1:20, ncol = 2))
Error in xy.coords(x = matrix(1:20, ncol = 2)) :
argument "y" is missing, with no default
> xy.coords(x = matrix(1:20, ncol =...
2007 Dec 12
2
problem applying a conditional formula to each element of a matrix
...only the first element will be used
# function
Cov.f <- function(h, sigmasq, phi) {
if (h <= phi) {Cij <- sigmasq * (1 - ( 1.5 * (h/phi) - 0.5 *
(h/phi)^3)) } else
if (h > phi) {Cij <- 0}
return(Cij)
}
x.coord <- c(5.7, 6.7, 9.8)
y.coord <- c(42.7, 10.2, 77.4)
coords <- cbind(x.coord, y.coord)
distance.matrix <- as.matrix(dist(coords, method="euclidean"))
distance.matrix
Cov.f(distance.matrix, 3.9, 58.1)
2011 Jan 20
1
Generating time progressing line for Google Earth
...in(lat1)*sin(lat2) + cos(lat1)*cos(lat2) *
cos(lon2-lon1)) * R
return(d) # Distance in km
}
########################
#---PROGRESSING LINE---#
########################
GenerateLineSegments <- function(start_point.Long, start_point.Lat,
end_point.Long, end_point.Lat, numberOfIntervals) {
coords <- matrix(NA, numberOfIntervals, 2)
full_distance = gcd.slc(lat1 = start_point.Lat, lon1 =
start_point.Long, lat2 = end_point.Lat, lon2 = end_point.Long)
distance_slice = full_distance / numberOfIntervals
for(i in 1 : numberOfIntervals) {
distance = i * distance_slice
ang_dist = distance / 6...
2007 Oct 02
0
[ wxruby-Patches-14375 ] bigdemo/wxScrolledWindow - paint bug with scrolled window
...this to save the current absolute...
@event_y_old = event.get_y # ... mouse position
@curLine = []
capture_mouse()
@drawing = true
end
end
----
And in on_left_button_event_motion
From:
paint do | dc |
dc.set_pen(Wx::Pen.new("MEDIUM FOREST GREEN", 4, Wx::SOLID))
coords = [@x, @y] + convert_event_coords(event)
@curLine.push(coords)
coords.flatten!()
dc.draw_line(coords[0], coords[1], coords[2], coords[3])
set_XY(event)
end
To:
paint do | dc |
dc.set_pen(Wx::Pen.new("MEDIUM FOREST GREEN", 4, Wx::SOLID))
save_coords = [@x, @y] + convert_event_...
2013 Apr 26
1
[newbie] how to find and combine geographic maps with particular features?
...ent object
> LCC.parallels=c(33,45), # LCC standard parallels: see https://github.com/TomRoche/cornbeltN2O/wiki/AQMEII-North-American-domain#wiki-EPA
> CRS # see `sp::CRS`
> ) {
> library(M3)
> ## Will replace raw LCC map's coordinates with:
> metadata.coords.IOAPI.list <- M3::get.grid.info.M3(extents.fp)
> metadata.coords.IOAPI.x.orig <- metadata.coords.IOAPI.list$x.orig
> metadata.coords.IOAPI.y.orig <- metadata.coords.IOAPI.list$y.orig
> metadata.coords.IOAPI.x.cell.width <- metadata.coords.IOAPI.list$x.cell.width
> me...
2011 Dec 21
1
Gps fraction of degrees function
Dear all, I have the following written example
> coords <- "51°30'48.58\"N"
>
> as.integer(strsplit(coords, "°")[[1]][1])
[1] 51
> as.integer(strsplit(strsplit(coords, "°")[[1]][2], "'")[[1]][1])
[1] 30
> as.numeric(strsplit(strsplit(strsplit(coords, "°")[[1]][2], "'...
2000 Nov 20
1
Bug in stars.R (PR#739)
Hi all,
Please let me know if this isn't the correct place to report bugs in
contributed code. Otherwise, the following code contains one additional
line and a short comment above it. The extra line of code catches the
unusual situation where a data column contains all 0 values.
The corrected code is below the signature.
Thanks for your help.
Tom
Thomas S. Dye, Ph.D.
2001 May 04
1
scoping error in xy.coords (PR#932)
Hola!
> rm(list=ls(all=TRUE))
> x <- 1:20
> y <- 1+x+rnorm(x)
> xy.coords(y ~ x,NULL)
... expected output, correct, but when called from inside lowess:
> lowess(y ~ x)
Error in xy.coords(x, y) : x and y lengths differ
> debug(xy.coords)
> lowess(y ~ x)
debugging in: xy.coords(x, y)
... long listing deleted
if (is.language(x)) {
if (inherits(...
2011 Feb 21
2
(no subject)
...ambda*area)
> u = runif(N,-2,4)
> v = runif(N,0,4)
> plot(u,v,asp=1)
> h = chull(u,v)
> h = c(h,h[1])
> plot(u[h],v[h],"1",asp=1)
Error in plot.xy(xy, type, ...) : invalid plot type '1'
> plot(u[h],v[h],"l",asp=1)
> points(u,v)
Error in plot.xy(xy.coords(x, y), type = type, ...) :
plot.new has not been called yet
> pts=as.points(u,v)
> pointmap(pts)
> hullpoly=as.points(u[h],v[h])
> polymap(hullpolly,add=TRUE)
Error in xy.coords(x, y) : object 'hullpolly' not found
> help(polymap)
> help(plot.net)
No documentation for ...
2013 Apr 14
2
script works in Rgui, but failes in Rscript (coords, package 'pROC')
...1, 1.874567e-02,
5.127498e-01, 9.438651e-03, 2.162788e-01, 9.142649e-04, 1.173577e-01,
7.270350e-03, 4.699286e-01, 4.553215e-03, 3.942892e-01)
roc_test <- data.frame (hits, score)
roc1 <- roc(roc_test$hit, roc_test$score, plot = FALSE, smooth = FALSE,
sensitivities = TRUE )
roc.result <- coords(roc1, "best", ret=c("t", "se", "sp"), as.list = TRUE,
best.method=c("closest.topleft"))
print(roc.result$best$threshold)
# script ends here.
However, executing in the command line
(C:\Progra~1\R\R-2.15.3\bin\Rscript.exe ROC_test.R) gives following...
2007 Oct 26
1
Help needed on calculation of Moran's I
...mat.
I have used the dnearneigh() funtion now with an arbitrarily high upper
distance to make it include all plots. However, when I do the
lm.morantest() I get a Moran's I value which is the same as the expected
value and a P-value of 1.
I have used the following code:
>attach(lowland)
>coords <- as.matrix(cbind(long, $lat))
>coord.nb <- dnearneigh(coords, 0, 10000 longlat=TRUE)
>coord.list <- nb2listw(coord.nb, style="W")
>lianasp.lm <- lm(lianasprich ~ log(averdist) + dsl + lianadens +
wooddens)
>lm.morantest(lianasp.lm, coord.list, alternative="t...