Displaying 20 results from an estimated 600 matches similar to: "lattice bug? (PR#2765)"
2006 Aug 02
1
Support vector in lcrabs example
Can anyone explain the root of my problem?
When I type the following code into R, I receive 42 support
vectors insted of the 21 stated in the book 'Modern Applied
Statistics with S':
library(MASS);
library(e1071);
library(class);
lcrabs <- log(crabs[,4:8]);
(svm(crabs$sp ~ ., data = lcrabs, cost = 100, gamma = 1));
By changing the value of gamma I can obtain only 21 support vectors,
2004 Jun 18
2
can't get text to appear over individual panels in multi-panel plot
I'm trying to learn how to create Trellis multi-panel plots, but I'm
having some trouble reproducing the graphs shown in Venables & Ripley
(2002) (e.g., Figs 4.14 & 4.15). Actually, everything looks fine except
for the fact that I can't see any text above the individual panels.
I'm using R 1.9.0 for OS-X running on Mac OSX 10.3.3, and I'm drawing
the graphs into
2003 Jun 10
1
SOM random seed
Hi all,
I have a question about the SOM routine. You can either supply the
initial representatives for the lattice yourself or else they are
chosen randomly from the dataset. Is it possible to pass the
random-seed as an argument somehow, when choosing the random
initialisation of the lattice?
As it is now, each time I run a SOM on a dataset with the same settings
the resulting SOM will still
2003 Mar 04
3
question on latticeParseFormula (PR#2602)
This feels like inconsistent behavior. latticeParseFormula works the
way I anticipated for factor, but not for ordered. I want the
behavior I see with tmp2, but not with tmp. My next step is to use
the right.name to isolate the tmp2[,c("a","b")] columns.
tmp <- data.frame(y=(1:12)+.1,
a=factor(rep(1:3,4)),
b=ordered(rep(1:4,
2000 Mar 08
3
Reading data for discriminant analysis
Dear R users,
I want to do discriminant analysis on my data. I have
successfully followed the discriminant analysis in V & R on
the iris data:
> ir <- rbind (iris3[,,1],iris3[,,2],iris3[,,3])
> ir.species <- c(rep("s",50),rep("c",50),rep("v",50))
> a <- lda(log(ir),ir.species)
> a$svd^2/sum(a$svd^2)
[1] 0.996498601 0.003501399
> a.x <-
2008 Jun 11
3
Finding Coordinate of Max/Min Value in a Data Frame
Hi,
Suppose I have the following data frame.
__BEGIN__
> library(MASS)
> data(crabs)
> crab.pca <- prcomp(crabs[,4:8],retx=TRUE)
> crab.pca$rotation
PC1 PC2 PC3 PC4 PC5
FL 0.2889810 0.3232500 -0.5071698 0.7342907 0.1248816
RW 0.1972824 0.8647159 0.4141356 -0.1483092 -0.1408623
CL 0.5993986 -0.1982263 -0.1753299 -0.1435941 -0.7416656
CW
2008 Jan 27
3
need help opening a file
Hi, I can't believe I am unable to do this. I just installed R (never used
it before, but want to learn it). At present, though. all I want to do is
export a data file (specifically "crabs" in the MASS library) to a text file
for use in SPSS. It allows me to peek into the dataset, using the command
head(crabs) but I can neither view the entire file nor can I seem to export
it to a
2007 Jan 26
1
Question about the xgobi package
Hi,
When I tried an example of the xgobi function, I got the following error. Could someone explain to me
what is wrong ? Thanks a lot.
xgobi(crabs,colors=c("SkyBlue","SlateBlue","Orange","Red")[rep(1:4,each=50)])
c:/PROGRA~1/R/R-23~1.1/library/xgobi/scripts/xgobi.bat -vtitle 'crabs' -std mmx
2007 Apr 20
1
xyplot: Combining 'subscripts' and 'allow.multiple=T'
Dear all, Consider this plot
xyplot(Sepal.Length + Sepal.Width ~ Petal.Length | Species,
data = iris, allow.multiple=T, outer=F,
panel = function(x,y,...) {
panel.xyplot(x,y,...)
}
)
I want to *add* some things to each panel and what I want to add involves using the data for each panel, so I try to take this subset of data out with subscripts:
2011 Jul 22
1
3d plotting with cloud and wireframe
Hi,
I'm trying to plot an equation in two variables to get a feel
for sensitivity to its parameters. I've run expand.grid to get made-up
vectors of the combinations of the two independent variables, and am trying
to plot the output of the dependent, M, against both the dependent in a 3d
space.
t <- 0:100
DBH <- 10:100
TxDBH<-expand.grid(t,DBH)
time<-TxDBH[,1]
2007 Aug 01
1
Splom custom superpanels
I thought one nice addition to a splom figure would be to have the
scatterplots in the upper triangle and a color-coordinated
correlation matrix on the bottom. So I tried my hand at customizing
panel.pairs(), and was rebuffed. Many times. Four hours of
fruitless debugging later, I turn to you for help:
panel.pairs(z=teststatfull[,6:12], pscales=0,
panel.subscripts=FALSE, subscripts=,
2008 Sep 21
1
How to put given values in lower triangle of splom-plot?
Dear R-experts,
I have found a splom-modification online which is given below. This
works perfectly, but I would like to have a matrix of given
correlation values to be used in the lower triangular part
(lower.panel) of the splom-plot instead of calculated correlation
values. Here is the matrix I would like to use (it can be any other
convenient data structure):
2010 Jan 31
1
accessing column and row numbers inside splom in lattice
Hi,
When using splom() in the lattice package, I would like to be able to
access the row and column number of each individual pairs plot ,
similar to the way that current.row() and current.column() can be used
in other lattice plotting functions such as xyplot. For example, I
would like to be able to write something along the lines of
library(mvtnorm)
library(lattice)
y <-
2010 Jan 15
1
Lattice: How to color the data points in splom() according to the panel they are plotted?
Dear ExpeRts,
I have the scatter plot matrix as given below. I would like the different "sub-plots" in the scatter plot matrix to be colored differently. How do I get all points shown in the upper-left plot (on position (1,1) in the scatter plot matrix) to be plotted in blue, and the points shown in the plot to the right (on position (1,2) in the scatter plot matrix) to be plotted in
2007 Aug 30
2
Additions to xyplot (lattice)? - legend, ticks, axis label size, text
I have created an xyplot of a time series with the following code...
win.graph(width = 10, height = 7)
panel1 = function(x, y) {
panel.loess(x, y, lwd=2.5, span=0.5, col="gray")
panel.xyplot(x, y, pch=19, col="blue", cex=1.25)
}
xyplot(oneplusdensity ~ year, data=figdata, aspect="fill", cex=1.5,
xlab=NULL, ylab=expression("Crabs per
2010 Nov 26
1
How to use expression(italic()) in a "vectorized" way (within a function)?
Dear expeRts,
I would like to use expression() for creating labels in a splom, as shown in the
first minimal example below. Is there any way I can simplify having to write
"expression(italic(...))" several times?
The second example is what I tried so far, but I can't manage to get italic() to
work. Moreover, it still seems bulky...
Cheers,
Marius
## minimal example (working but
2010 Sep 30
2
panel.pairs in splom
Hello,
I have a customized pairs () fonction as follows that displays correctely my
data.
------------------------------------------------------------------------
panel.cor1 <- function (x, y, digits=2, prefix="")
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- cor(x, y,use="pairwise.complete.obs",
2012 Dec 11
1
Focus on a sub-panel of a splom with trellis.focs() -- return coordinate of sub-panel, or names of variables therein
Hi,
I'd like to be able to generate a splom plot in R and then use my mouse to click on one of the sub-panels (panel.pairs, specifically) and have R return either the coordinates of that sub-panel, or even better, the names of the corresponding variables plotted in that sub-panel.
Here's an example to work with:
> library(lattice)
> splom(~iris[1:4], groups = Species, data = iris,
2010 Oct 07
1
Lattice: Histogram in splom diagonals
Dear list, I want to plot several variables with splom and in the main
diagonal, instead of the variable names, I'd like to plot an histogram of
corresponding variables. Searching I did not find the correct syntax, only
some tips in an old post in the list, but this comments help to plot only
density lines instead of histograms. I had some code, but it fails to plot
(I've commented the
2007 Oct 16
1
Adding axis lines to splom plots
Hi,
I am trying to produce a 30x30 lattice grid. The 30 variables naturally
fall into three groups of ten and I would like to add thicker axis lines
around these to highlight this. However, I can only do this separately,
so far, and I don't know how to superimpose the grid with the thicker
lines (separating the 10x10 groups) onto the overall grid of all 30x30
plots. I enclose a