Displaying 20 results from an estimated 700 matches similar to: "xlim and ylim on npudens (np package)"
2016 Apr 22
1
npudens(np) Error missing value where TRUE/FALSE needed
Hi,
I am looking for some help concerning the npudens function
in the np package.
I am trying to find a kernel density function of a
multivariate dataset and the density evaluated at each of the 176 points.
I have 2 continuous and 3 ordered discrete variables. My
sample size is 176.
So edata is a 176x(2+3) data frame, while tdat is a 1x(2+3)
vector.
bw_cx[i,] is a 1x (2+3) vector
2009 Dec 14
0
Confused on using expand.grid(), array(), image() and npudens(np) in my case
Hi all,
I want to use the npudens() function in the np package (multivariate
kernel density estimation), but was confused by the several functions in the
following codes,expand.grid(),array(),image() and npudensbw().
This confusion will only be generated in >=3 dimensions. I marked the four
places with confusion1-4. I think there should be some kind
of correspondence in those four
2010 Apr 07
0
exporting rotating plot into Powepoint
Hi,
I need to export a rotating plot like the one generated from the following function into a PPT slide or something that can be viewed by reviewers of a journal:
library(np)
library(datasets)
data(faithful)
f <- npudens(~eruptions+waiting,data=faithful)
plot(f,view="rotate",neval=100,phi=30,main="",xtrim=-0.2)
Thanks!
Gabriele Zoppoli, MD
Ph.D. Fellow,
2010 Nov 14
1
R package 'np' problems
Hi List,
I'm trying to get a density estimate for a point of interest from an npudens
object created for a sample of points. I'm working with 4 variables in total
(3 continuous and 1 unordered discrete - the discrete variable is the
character column in training.csv). When I try to evaluate the density for a
point that was not used in the training dataset, and when I extract the
fitted
2010 Nov 03
0
package 'np' and point estimation with multiple predictors
(disclaimer: I'm in physics, not stats... )
I have a multivariate problem.
One variable, call it R1, and 3 "predictor" variables, P1, P2, P3.
My goal is to take a load of training data (I know R1,P1,P2,P3 for about
700 total points), and then predict R1 for a new set of data for which I
have all the predictors. Simple, no?
I understand how to calculate bandwidths, and I have a
2010 Nov 19
1
Sampling from multi-dimensional kernel density estimation
Hi,
I'd like to use a three-dimensional dataset to build a kernel density and
then sample from the distribution.
I already used the npudens function in the np package to estimate the
density and plot it:
fit<-npudens(~x+y+z)
plot(fit)
It takes some time but appears to work well.
How can I use this to evaluate the fitted function at a certain point, e.g.
(x=1, y=1, z=1)?
2010 Feb 06
1
Why does smoothScatter clip when xlim and ylim increased?
Hi:
Is there a way to get smoothScatter to not clip when I increase the xlim and
ylim parameters?
Consider the following example:
set.seed(17)
x1<-rnorm(100)
x2<-rnorm(100)
smoothScatter(x1,x2)
#Now if I increase xlim and ylim notice that the plot seems to be clipped at
the former xlim, and ylim boundaries:
smoothScatter(x1,x2, xlim=c(-5,5), ylim=c(-5,5))
Thanks.
Jen
sessionInfo()
R
1999 Nov 15
1
xlim, ylim problem in barplot (PR#325)
Hi, all.
The lower bound in a barplot (or the left bound if you're making a
horizontal barplot) is -0.01 no matter what. This causes problems if
you're making a barplot of small values (say, < .001), as most of the plot
is taken up with blank space beneath the axis, and the bars are squeezed
in at the top. The fix seems to be simple: replace lines
41: xlim <- range(-0.01,
2003 Aug 25
1
setting xlim and ylim with asp=1
In plot(), when using option asp=1 the xlim and ylim have no effect because
they are changed
changed in order to fill the whole plot region. Is there a way to
automatically set
xlim and ylim when asp has been set to 1?
For example:
#This is a box of the plot ranges I want:
boxxy=rbind(c(-1,2),c(-1,-1),c(1,-1),c(1,2),c(-1,2))
#Without asp=1 I get what I want (i.e. I can't see the box because it
2007 Sep 20
1
ggplot and xlim/ylim
Hello everyone,
I am (happily) using ggplot2 for all my plotting now and I wondered
is there is an easy way to specify xlim and ylim somewhere when using
the ggplot syntax, as opposed to the qplot syntax. Eg.
qplot(data=mtcars,y=wt, x=qsec,xlim=c(0,30))
<->
ggplot(mtcars, aes(y=wt, x=qsec)) + geom_point() + ???
Indeed the ggplot syntax is in general more flexible and powerful and
2009 Feb 11
0
contour( ..., method='edge') incompatible with xlim & ylim
Hello,
A colleague of mine in our oceanography lab has pointed out a slightly
annoying imperfection with the contour plotting function. It appears
that the 'edge' option for the 'method' parameter doesn't work very
well (or at all?) when xlim and ylim are also set.
The following code should recreate and demonstrate the problem:
2012 Jan 10
0
rworldmap: xlim, ylim do not change plotting region
Specifying xlim or ylim in the mapCountryData function of the rworldmap library do not alter the plotting region on my system.
#Using the example from rworldmap
library(rworldmap)
mapCountryData() #uses the sample dataset
mapCountryData(ylim = c(-45,45)) #makes no difference to the plot
R 2.14.1 on Linux Mint 11 64bit.
Thanks,
Dan
________
Dr Dan Bebber
Head of Climate Change Research,
2010 May 26
2
xlim/ylim and actual axis length
Dear plotting wizards,
when plotting in R, the actual lengths of the axes are slightly
greater than the ranges of the x/y variables or xlim/ylim values.
how do I control the amount by which the axes are enlarged? Is
there a way to enforce that the lengths of the axes equal
xlim/ylim?
example:
plot(0:100,0:100,pch="+")
it can be observed, that the x- and y-axis join at approx.
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,
2009 Apr 22
1
reversing xlim, ylim in smoothScatter
Hello,
I have found that in smoothScatter it is not possible to reverse the axes plotted (R version 2.9.0) . It appears that this arises from the hard coding of xlim and ylim in smoothscatter.R in the lines :
x <- x[ xlim[1] <= x[,1] & x[,1] <=xlim[2], ] (line number 25)
and
x <- x[ ylim[1] <= x[,2] & x[,2] <= ylim[2], ] (line number 31)
This results in a x
2004 Sep 22
1
pairs, panel.functions, xlim and ylim
Hi,
I have the following problem.
I wanted to get a matrix of scatterplots and I used pairs.
I wanted to add the line y=x in each plot and I created a panel
function for this scope.
I used points and abline in the following way:
## put y=x in each plot
panel.lin<- function(x, y)
{
points(x,y, pch=21, bg=par("bg"), col = "black",cex=2)
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
2008 Sep 03
1
ugly plots with xlim/ylim exceeding data range (changed since R2.6.1)
The behaviour of the plot function when used with xlim/ylim and the
matplot function as in the following simple example changed between
R2.6.1 and 2.7.0+ producing ugly plots in the new versions. In case of
plot it looks like the pretty function is called with wrong arguments
(i.e. range of supplied data rather than values of xlim and ylim):
m = matrix(c(-0.033, 0.009, 0.064, 0.050, 0.097,
2010 Nov 10
3
plot & xlim/ylim & range of axis
Dear mailing list readers!
Using R and the plot function I stumbled over this little issue:
plot(x=NULL,
y=NULL,
xlim=range(1:10),
ylim=range(1e-9:1),
log="y")
produces an plot empty plot, where the y-axis is in the specified range.
Changing ylim to
ylim=range(1e-9:1e-3)
creates an y-axis in the range of 1e-12 to 1e-6. This appearance of the
y-axis is a
2007 Jul 10
2
Plot SpatialLinesDataFrame with xlim & ylim
I'm running windows xp, R 2.3.1 with maptools 0.6-6, I guess.
When plotting from a large SpatialLinesDataFrame and using xlim & ylim to reduce the area, the plot axes automatically have the same scale size, even if xlim and ylim ranges differ.
E.g.:
tmp <- readShapeLines(filepath)
plot(tmp,xlim=c(-126,-119),ylim=c(50,51))
The y-axis range is actually 47-54, same range as the x-axis.