Displaying 20 results from an estimated 1000 matches similar to: "Vertical bars with barchart"
2008 May 08
1
Reading multiple tables from file
Dear R-users,
I have output files having a variable number of tables
in the following format:
-------------
1
Pietje
I1 I2 Value
1 1 0.11
1 2 0.12
2 1 0.21
2
Jantje
I1 I2 I3 Value
1 1 1 0.111
3 3 3 0.333
...
-------------
Would there be an easy way
of turning this into (a list of) data.frames
with names Pietje, Jantje
and variables I1,I2,...Value?
(I1,I2 are string or categorical,
2008 Jul 30
1
Unexpected line type in lattice plot key on pdf device
L.S.,
With the code below,
on the Windows screen the line types in the key show
as solid and dashed as in the graph,
and in the pdf file they show
as solid in the key and solid and dashed in the graph.
I would not expect that,
but may be I get something wrong.
Gerrit.
-------
library(lattice)
# pdf("pietje.pdf")
x<-0:10
xyplot((x^0.5)+(x^0.75)~x,type="o",lty=c(1,2),
2010 Dec 07
3
understanding output of tapply/by cumsum
Dear R-users,
I have a dataset with categories and numbers.
I would like to compute and add cumulative numbers
to the dataset.
I do not understand the structure of by(...) or
tapply(...) output enough to handle it.
Here a small example
--------------
d<-expand.grid(a=1:5,b=1:3,c=1:2)
d$n = 10 * d$a + d$b +0.1* d$c
Sn<-by(d$n,list(d$a,d$c),cumsum)
str(Sn)
---------
List of 10
$ : num
2007 Aug 01
2
Simple table with frequency variable
Hallo,
Im trying to find out how to tabulate frequencies
of factors when the data have a frequency variable.
e,g:
i<-rep(1:5,2)
j<-rep(1:2,5)
N<-10*i+j
table(i,j) gives a table of ones
as each combination occurs only once.
How does one get a table with the corresponding N's?
Thanks!
Gerrit.
--
Gerrit Draisma
Department of Public Health
Erasmus MC, University Medical Center
2012 May 09
5
Dotchart showing mean and median by group
Given this example
mean.values<-colMeans(VADeaths)
mean.values<-apply(VADeaths, 2, mean)
median.values<-apply(VADeaths, 2, median)
dotchart(VADeaths, gdata=mean.values)
dotchart(VADeaths, gdata=median.values)
is it possible to ?combine? a single dotchart showing both the mean and the
median for each single group (with different plotting symbols)?
?is it that possible with the use of
2024 Sep 05
1
lattice log scale labels.
Do the "at" and "labels" components of the "scales" list argument to xyplot
not do what you want?
Cheers,
Bert
On Thu, Sep 5, 2024 at 4:05?AM Gerrit Draisma <gdraisma at xs4all.nl> wrote:
> Dear R-helpers,
>
> In the plot below I would like to have labels at positions 2^(3*(0:10)),
> and keep the labels in the exponential format.
> I tried
2011 Nov 14
2
how to include integrate in a function that can be solved with uniroot?
Hallo,
I am trying to define expectation as an integral
and use uniroot to find the distribution parameter
for a given expectation.
However I fail to understand how to define properly
the functions involved and pass the parameters correctly.
Can anyone help me out?
Thanks,
Gerrit Draisma.
This what I tried:
=======
> # exponential density
> g <- function(x,lambda){ lambda
2001 Jan 18
2
dotplot: character size of labels
Dear R users,
using dotplot (R1.2.0, WinNT4.0), I am trying to change the character size
of the labels of the points:
> # example
> data(VADeaths)
> dotplot(VADeaths, main = "Death Rates in Virginia - 1940")
> # I'd like to have smaller character size of the labels (for age and
population groups)
> ?dotplot
> # for argument "cex", this says:
2006 Dec 28
2
Plot window - save as Postscript question
R 2.4.0 for Windows
The following plot appears as a squared window (as all r-plots)
Not all subtitles are visible, but all subtitle will appear, when
changing the aspect ratio of the plot window with the mouse to a wide
format.
But does not work when using the save as postscript menu item from the
plot window.
is there any solution for that?
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1,
2005 Nov 14
1
bug/feature with barplot?
I have found a bug/feature with barplot that at least to me shows
undesireable behaviour. When using barplot and plotting fewer
groups/levels/factors(I am unsure what they are called) than the number
of colors stated in a col statement, the colors wrap around such that
the colors are not fixed to one group. This is mostly problematic when
I make R figures using scripts, since I sometimes have
2001 Feb 05
1
Bar widths in barplots don't change
Is the width= parameter in barplot() supposed to work? I couldn't get it to
work in my plot, and even in the example,
data(VADeaths, package = "base")
barplot(VADeaths, width=rep(0.1, 4))
the plot looks identical regardless of what I put in for the width. I looked at
the source for barplot() and it looks like it SHOULD work (but what do I know).
Am I doing something wrong?
2010 Nov 10
1
ggplot2 problem in interacting mode
Hi all,
When running R interactively, I have the problem as following:
> library(ggplot2)
Loading required package: reshape
Loading required package: plyr
Attaching package: 'reshape'
The following object(s) are masked from 'package:plyr':
round_any
Loading required package: grid
Loading required package: proto
> data(VADeaths)
> pg <- ggplot(melt(VADeaths),
2005 May 04
1
Plotting means and confidence intervals by group factor using lattice graphics?
Dear R graphics gurus,
Another question about lattice graphics. This time I would like to plot
means and confidence intervals by group factor in a lattice graph. I can
not find any working lattice examples. Maybe a custom panel function is
the answer, but that is a bit beyond me for now.
The individual plots within the lattice graph could look like this:
# Example with confidence intervals
2024 Sep 14
1
how to specify point symbols in the key on a lattice dotplot
On Fri, 13 Sept 2024 at 23:36, Christopher W. Ryan
<cwr at agencystatistical.com> wrote:
>
> For me, Bert's suggestion produces a plot with two black symbols above
> the plotting region, a circle and a triangle, both filled, and no text.
>
> This, in which I specify several features of the symbols in the key,
>
> dd %>% dotplot( segment ~ transit_time, groups =
2009 Feb 02
1
Broke ggplot...
It appears I broke ggplot in my script, but that maybe it is because the caffeine has worn off or maybe it is late in the day. I thought I was beginning to understand ggplot, but I have encountered a silly little issue.
For some reason the following does not produce a histogram with fill due to the Person's characteristics:
(Note that VADeaths_flat_df$Data works fine...)
2024 Sep 13
1
how to specify point symbols in the key on a lattice dotplot
For me, Bert's suggestion produces a plot with two black symbols above
the plotting region, a circle and a triangle, both filled, and no text.
This, in which I specify several features of the symbols in the key,
dd %>% dotplot( segment ~ transit_time, groups = impact, data = .,
pch = 16:17,
col = 1:2,
cex = 1.8,
scales =
2009 Jun 06
1
correct line types in lattice legends
Hallo R-users,
I do not understand how to specify the correct
line and symbol types in the legends of a lattice xyplot.
This is what I tried, but the line types and symbol in the
graph are not seen in the legend.
Any help is appreciated.
Thanks,
Gerrit.
library(lattice)
s<-rep(1:3,len=10)
x<- 1:10
y<- x+s+rnorm(10)
d<-data.frame(s,x,y)
xyplot(y~x, groups=s,data=d,
2024 Sep 05
1
lattice log scale labels.
Dear R-helpers,
In the plot below I would like to have labels at positions 2^(3*(0:10)),
and keep the labels in the exponential format.
I tried using yscale.components.default.
*This* gives the right format of the labels:
--------
> yscale.components.default(lim= c(0,30),log=2)
....
$num.limit
[1] 0 30
...
[1] 0 5 10 15 20 25 30
...
$left$labels$labels
[1] "2^0" "2^5"
2008 Jun 04
1
dotchart
I am trying to plot the following data using dotchart
intersect.data<-structure(list(X = structure(c(1L, 3L, 8L, 9L, 10L, 11L, 12L,
13L, 14L, 15L, 2L, 4L, 5L, 6L, 7L), .Label = c("1-100", "1001-1100",
"101-200", "1101-1200", "1201-1300", "1301-1400", "1401-1500",
"201-300", "301-400", "401-500",
2010 Jun 09
1
barplot of a table
Good morning,
I've been dabbling in R, so my knowledge has quite a few holes in it. I'm
hoping that this has a simple answer and just falls into one of those holes.
I have a table of percentages that I want to display as a barchart. Groups
1-4 in columns and Variables 1-5 in rows, with the percentage of each group
expressing interest in each variable in the cells. In Excel I just