similar to: Weird behavior with names()

Displaying 20 results from an estimated 30000 matches similar to: "Weird behavior with names()"

2007 Jan 17
1
sp: proj4string has no impact
Hi all, I'm faced with a problem applying the sp package: The projection argument in readShapePoly(Shapefile,proj4string="CRS class argument") e.g.: CRS("+proj=aea +lat_1=46 +lat_2=73 +lat_0=60 +lon_0=84 +x_0=0 +y_0=0 +ellps=clrk66 +units=m +no_defs") doesn't have any impact on the plotted object. I also tested the simple example: xy = cbind(x = 2 * runif(100) -
2000 May 25
9
problem on upgrading to RH6.2 (was problem with ts pack
plummer at iarc.fr said: > On 24-May-00 Prof Brian D Ripley wrote: > On Wed, 24 May 2000, Christian Posse wrote: > >> >> I just encountered a problem with the ts package: >> >> > > library(ts) >> Error in dyn.load(x, as.logical(local), > as.logical(now)) : >> unable to load shared library >> "/usr/ >
2009 Feb 16
2
solve.QP with box and equality constraints
Dear list, I am trying to follow an example that estimates a 2x2 markov transition matrix across several periods from aggregate data using restricted least squares. I seem to be making headway using solve.QP(quadprog) as the unrestricted solution matches the example I am following, and I can specify simple equality and inequality constraints. However, I cannot correctly specify a constraint
2011 Aug 15
1
2 matrix scatter x [a lot]
Hello, I'm pretty new to R. Basically, how do I speed up the for loop below. Or better yet, get rid of the for loop all together. objective: plot two data sets column against column by index. These data sets have alot NA's. Some columns are all NA's. I need the plots to overlay. I don't like the plots in matplot(). Needs to be much faster than the code below... #simple sample
2012 Nov 17
3
transform input argument (matrix) of function
Dear list!   I would like to write a function to transform matrix, which is input argument of a written function. It is easy with new matrix (see below), but my idea is to transform input argument (matrix) of function without any additional matrixes. Here is an example: fun1 <- function(xy) { xy <- cbind(xy[,1], xy[,2], xy[,1] + xy[,2]) return(xy) }   df1 <- matrix(c(1,2,3,1,2,3), ncol =
2009 Jun 09
3
Splicing factors without losing levels
Hi list! An operation that I often need is splicing two vectors: > splice(1:3, 4:6) [1] 1 4 2 5 3 6 For numeric vectors I use this hack: splice <- function(x, y) { xy <- cbind(x, y) xy <- t(xy) dim(xy) <- length(x) * 2 return(xy) } So far, so good (?). But I also need splicing for factors and I tried this: splice <- function(x, y) { xy <-
2012 Aug 18
1
Parameter scaling problems with optim and Nelder-Mead method (bug?)
Dear all, I?m having some problems getting optim with method="Nelder-Mead" to work properly. It seems like there is no way of controlling the step size, and the step size seems to depend on the *difference* between the initial values, which makes no sense. Example: f=function(xy, mu1, mu2) { print(xy) dnorm(xy[1]-mu1)*dnorm(xy[2]-mu2) } f1=function(xy) -f(xy, 0,
2010 Aug 31
1
"pairs" with same xlim and ylim scale
Hi list, I have a function which basically is a wrapper of pairs with some useful panel functions. However, I'm having trouble to pass the "xlim" and "ylim" into the function so the x and y axes are in the same scale and 45 degree lines are exactly diagonal. I've looked at some old posts, they didn't help much. I think this is b/c I have multiple panel
2006 Sep 13
1
forcing levelplot to use relative cuts (ie cuts for each panel)
Dear guRus, I'm having trouble producing a levelplot with relative cuts for each panel (my data has large differences in scales, so I want to use quantiles for each panel). My attempts to change the 'at' argument in panel.levelplot function have not met with success. Below is a toy example. xy <- expand.grid(x = 1:3, y = 1:3) aaa <- rbind(cbind(xy, z = 1:9, site =
2010 Aug 26
1
Passing arguments between S4 methods fails within a function:bug? example with raster package.
Dear all, This problem came up initially while debugging a function, but it seems to be a more general problem of R. I hope I'm wrong, but I can't find another explanation. Let me illustrate with the raster package. For an object "RasterLayer" (which inherits from Raster), there is a method xyValues defined with the signature
2003 Oct 15
3
Strange scope problem
Hi, I have come across the following problem which seems to be a scoping issue but I'm at a loss to see why this is so or to find a good workaround. Suppose I have a function to get a prediction after model selection using the step function. step.pred <- function(dat, x0) { fit.model <- step(lm(y~., data=dat), trace=F) predict(fit.model, x0, se.fit=T) } This function works
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 = 2), y = NULL) $x [1] 1 2 3 4 5 6 7 8 9
2005 Jan 22
1
Plotting with Statistics::R, Perl/R
I am trying to plot in R from a perl script using the Statistics::R package as my bridge. The following are the conditions: 0. I am running from a Linux server. 1. Even without xwindows the following saves test.png correctly from an interactive session with R: > xy<-cbind(1,1) > png("test.png") > plot(xy) > dev.off() 2. However, when called from the perl script I get
2009 Jun 25
1
Calculating home ranges using mcp in adehabitat
Hello, I've been trying to calculate home range sizes (for Icelandic geese!) using minimum convex polygons with the adehabitat package. I've tried to use the R code shown by demo(homerange) in adehabitat and when that didn't work I've fiddled around with it but to no avail...Below is the output of the demo that I've attempted to follow, followed by a subset of my data (for one
2011 Dec 07
2
How to scale arrows to approximately fill a plot region?
In a variety of graphic applications, I plot some data, together with arrows representing variables or linear transformations of variables as vectors in the same space, as in a biplot. In my applications, the scale of the arrows is arbitrary -- all that matters is relative length. I'd like to blow them up or shrink them to fit the available space in the plot. The origin is typically at
2008 Jun 04
5
help understanding why #function(x, y) (if((x-y)>=0) {2^(x-y)} else{-(2^abs(x-y))})# doesn't work like I think it should
Hello R users and developers, I am trying to write several functions (fairly new at this) in order to avoid using loops on large data frames (because they are slow). I wrote the function below and it seems to get hung on the first part of the if statement and then applies that condition to rest of the function. So if (x-y) is greater than 0 the function uses the true statement for the
2016 Feb 09
2
problem plotting "ts" in a data.frame
Hello: I'm having trouble plotting an object of class "ts" that is in a data.frame. I can do it with(data.frame, plot(...)) but not with plot(..., data.frame); see the example below. This work around gets me past this problem. However, I thought the R Core team might want to know about this if they don't already. Thanks for all your work in making
2005 Apr 19
2
Aspect ratio and limits
Suppose I have the following data I want to scatterplot: > xy [,1] [,2] [1,] 0 0 [2,] 21 4 I start up a graphics window and fire away: > plot(xy) - but because the graphics window is square, the aspect ratio is wrong. So I add: > plot(xy, asp=1) - now the aspect ratio is correct, but the Y range is about -8 to 11, whereas my data has a Y range of 0
2005 Dec 31
1
xy.coords
In ?xy.coords it says: If 'y' is missing and 'x' is a formula: of the form 'yvar ~ xvar'. 'xvar' and 'yvar' are used as x and y variables. list: containing components 'x' and 'y', these are used to define plotting coordinates. time series: the x values are taken to be 'time(x)' and the y
2013 Mar 05
2
Function completely locks up my computer if the input is too big
Dear r-help, Somewhere in my innocuous function to rotate an object in Cartesian space I've created a monster that completely locks up my computer (requires a hard reset every time). I don't know if this is useful description to anyone - the mouse still responds, but not the keyboard and not windows explorer. The script only does this when the input matrix is large, and so my initial