Displaying 20 results from an estimated 10000 matches similar to: "lattice: ordering the entries in a dotplot of a vector"
2006 Dec 08
1
lattice: defining an own function using args for "formula" and "groups"
x.fun <- function( formula, data ) dotplot( formula, data )
x.grp <- function( formula, groups, data ) dotplot( formula, groups, data )
data( barley )
> x.fun( variety ~ yield | site, data=barley )
# no problem
> dotplot( variety ~ yield | site, groups=year, data=barley )
# no problem
> x.grp( variety ~ yield | site, groups=year, data=barley )
object "year" not found
2004 Feb 12
2
lattice: showing panels for factor levels with no values
How to show panels for factor levels of conditioning variables
which do have no values?
E.g. there are panels for "Grand Rapids" when they have values:
data( barley )
with( barley, dotplot(variety ~ yield | year * site, layout=c(6,2) ) )
There are no panels for "Grand Rapids"
when there are no values for "Grand Rapids":
my.barley <- subset( barley, ! ( site ==
2004 Mar 04
1
lattice/grid: problem with viewports for strips with zero height
PROBLEM
# Allocating strip labels by the function strip.fun():
strip.test()
# Result: No strips: ok. No strings: NOT OK.
# The distance ``y.text=unit(6,"points")'' is ignored;
# the strings are not seen on the output.
TRIALS FOR WORKAROUNDS
strip.test( strip.lines=1 )
# Result: 2 strips: ok, but not whished. 2 strings: ok.
2004 Jan 20
1
lattice: adding text between grouped panels?
How one can add a text (e.g. the labels of an axis)
in a space between grouped panels which was created
by using the argument ``between''?
Example:
data(barley)
dotplot(variety ~ yield | site * year, data=barley,
between=list(x=c( 0, 0, 6 ))
How to add labels for the y axis in the space in the middle?
Thanks
Wolfram
2004 Oct 04
11
inverse function of order()
I have:
d <- sample(10:100, 9)
o <- order(d)
r <- d[o]
How I can get d (in the original order), knowing only r and o?
Thanks - Wolfram
2006 Nov 29
4
Why the factor levels returned by cut() are not ordered?
What is the reason, that the levels of the factor
returned by cut() are not marked as ordered levels?
> is.ordered( cut( breaks=3, sample(10 ) ) )
FALSE
> help(factor)
...
If 'ordered' is 'TRUE', the factor levels are assumed to be ordered.
...
Wolfram
2003 Jan 15
2
[lattice] lines for stripplot (like dotplot) or jitter for dotplot?
I'd like to use stripplot for some plots because I want to use
the jitter parameter. On the other hand, I'd like to use dotplot
because I'd like to have the horizontal lines that it includes.
dotplot doesn't have a jitter option and I'm not having any
success with getting panel.grid(h=-1) with stripplot. Can anyone
show me how to make dotplot-like lines on a stripplot? Or
2002 May 03
2
sub() of matrix returns a vector and not a matrix
Is there a simple possibility
to become directly a matrix
from a call of sub() on a matrix?
--------- START OF LOGFILE ----------------
# R 1.4.1
> a <- matrix( letters[1:6], 2, 3 )
# a is a matrix
> print( a )
[,1] [,2] [,3]
[1,] "a" "c" "e"
[2,] "b" "d" "f"
> b <- sub( '(.)', '-\\1-', a )
2023 Nov 07
1
make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe
Hello. My question is in the subject line. Using R 4.1.3 on Windows 10.
Commented MWE below. Thanks.
--Chris Ryan
library(dplyr)
library(lattice)
## fabricate a dataframe
dd <- data.frame(agency = sample(LETTERS, size = 5),
total = sample(100:200, size = 5),
las = sample(20:40, size = 5))
dd <- dd %>% mutate(proportion = las/total, bubble = total/100)
## attempt to make a dotplot
2005 Apr 11
6
How to change letters after space into capital letters
What is the easiest way to change within vector of strings
each letter after a space into a capital letter?
E.g.:
c( "this is an element of the vector of strings", "second element" )
becomes:
c( "This Is An Element Of The Vector Of Strings", "Second Element" )
My reason to try to do this is to get more readable abbreviations.
(A suggestion would be to
2008 Feb 14
1
{lattice/grid} "Error using packet 1" and traceback
On some errors during the plot of a lattice/grid graphics, there is written
a message like "Error using packet 1: missing value where TRUE/FALSE needed"
into the concering panel and the next panel is plotted.
Which option I could use to stop the execution to have a look
at the error by a traceback?
Regards - Wolfram
2003 Jan 24
4
new function: showcolors {base}
I propose to add a function that allows
to display colors selected by a text pattern
or by color vectors in a plot.
Wolfram Fischer
#--- showcolors.R
showcolors <-
function(
col = "red"
, index = NULL
, pie = TRUE
, lwd = 6
, cex = 1.0
, main = NULL
, sub = NULL
, ...
){
n.colors <- length( col )
if( n.colors > 1 ){
main <- deparse( substitute( col ) )
2009 Mar 03
1
dotplot() lattice charts return blank image (jpeg, bmp, png) file
Thanks in advance for the help. Trying to run a basic dotplot in lattice from R command line. When the file is created, in Fedora, it is blank image (jpeg, bmp, png). Image produces correctly in Windows environment. Libraries lattice and latticeExtra are loaded. Code:
-----------------
jpeg(file = "/tmp/img/temp31.jpg", width = 768, height=768)
xy <- dotplot(1:10)
print(xy)
2011 Feb 09
1
add mean and sd to dotplot in each panel using lattice
Hi,
I have a data frame like this:
ScoreDoseSex
2.81Dose1M
1.81Dose1M
1.22Dose1M
0.81Dose1M
0.49Dose1M
0.22Dose1M
0.00Dose1M
-0.19Dose1M
-0.17Dose1F
-0.32Dose1F
-0.46Dose1F
-0.58Dose1F
-0.70Dose1F
-0.81Dose1F
-0.91Dose1F
-1.00Dose1F
-1.77Dose2M
-1.85Dose2M
-1.93Dose2M
-2.00Dose2M
-2.07Dose2M
-2.14Dose2M
-2.20Dose2M
-2.26Dose2M
-2.32Dose2F
-2.38Dose2F
-2.17Dose2F
-2.49Dose2F
-2.54Dose2F
2006 Jul 07
2
dotplot (lattice) with panel.segments and groups
Hi,
The following produces almost exactly what I needed. The problems are
that the 'panel.dotplot' call (commented) generates the error 'Error in
NextMethod("[") : argument "subscripts" is missing, with no default'. The
other problem is that the colors alternate between the levels of the 'site'
variable, rather than 'year'.
barley$yield2
2007 Jul 26
1
How to auto-scale cex of y-axis labels in lattice dotplot?
When I create a dotplot in lattice, I frequently observe overplotting
of the labels along the vertical axis. On my screen, this illustrates
overplotting of the letters:
windows()
reps=6
dat=data.frame(let=rep(letters,each=reps), grp=rep(1:reps, 26),
y=runif(26*reps))
dotplot(let~y|grp, dat)
Is there a way to automatically scale the labels so that they are not
over-plotted?
I currently do
2003 Dec 22
1
[R] lattice: levelplot: error: min not meaningful for factor (PR#6005)
R 1.8.1:
___COMMAND____________________________________________
levelplot( yield ~ year * variety | site, barley )
___ERROR_MESSAGE______________________________________
Error in Summary.factor(..., na.rm = na.rm) :
"min" not meaningful for factors
___COMMENT____________________________________________
levelplot( yield ~ as.numeric(year) * as.numeric(variety) | site,
2008 Jun 16
2
Lattice: Superpose bwplot and dotplot [newbie question]
Hello everyone
I have dataset containing a monetary value (ABS) and two factors (Fct,
Group). I am able to create useful using:
bwplot(ABS~Group|Fct)
and
dotplot(ABS~Group|Fct)
Question: What do I have to do to overlay the dotplot with the bwplot (same
data set)?
I've found a couple of posts that hinted at the possibility of doing that,
and checked the panel.superpose() help, but the info
2011 Apr 07
1
dotplot as a background for multiple barchart plots (with Lattice)
Hi R users,
I'm kind stuck in my R experience...
I want to have a multiple barchart with n windows, but with the same
background for each window, and I want that background to be a recorded
dotplot.
First, is it possible ?
If so, I guess I have to call a record plot in the panel function but how ?
As there is no panel.plot and I can't use the recorded plot as an
argument for the
2010 Jan 14
1
lattice dotplot with missing levels in factor variable
Hi,
I am trying to create a dotplot where each panel shows levels vs.
responses; the levels are sorted by responses but levels vary from one
panel to another. However, I run into problems with controlling the
y-limits and y-labels.
In particular, suppose I have a data frame
rsp <- c(10,2,4,0,2,3)
lvl <-