Re: [R] Histogram from a table in R

2012-04-03 Thread Peter Alspach
Tena koe Possibly barplot() is what you are after. ?barplot HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of gina_alessa Sent: Wednesday, 4 April 2012 9:08 a.m. To: r-help@r-project.org Subject: [R

Re: [R] Histogram from a table in R

2012-04-03 Thread Robert Baer
intv = c('0-19','10-19','20-29','30-39') cnts = c(0, 3117, 4500, 2330) barplot(cnts, space=0, names = intv, xlab='Age Range', ylab = 'Counts', main='My Histogram') -Original Message- From: gina_alessa Sent: Tuesday, April 03, 2012 4:08 PM To: r-help@r-project.org Subject: [R

[R] histogram break width

2012-03-29 Thread Vihan Pandey
Hi all, I am generating histograms with the following R script : #!/usr/bin/Rscript out_file = histo.png png(out_file) scan(values.csv) - myvalues hist(myvalues, breaks = 50) dev.off() print(paste(Plot was saved in:, getwd())) I want the histogram to have a larger number of breaks, but a

Re: [R] histogram break width

2012-03-29 Thread Sarah Goslee
See below: On Thu, Mar 29, 2012 at 10:05 AM, Vihan Pandey vihanpan...@gmail.com wrote: Hi all, I am generating histograms with the following R script : #!/usr/bin/Rscript out_file = histo.png png(out_file) scan(values.csv) - myvalues hist(myvalues, breaks = 50) dev.off()

Re: [R] histogram break width

2012-03-29 Thread David Winsemius
On Mar 29, 2012, at 10:12 AM, Sarah Goslee wrote: See below: On Thu, Mar 29, 2012 at 10:05 AM, Vihan Pandey vihanpan...@gmail.com wrote: Hi all, I am generating histograms with the following R script : #!/usr/bin/Rscript out_file = histo.png png(out_file) scan(values.csv) - myvalues

Re: [R] histogram

2012-02-06 Thread Francis Keyes
Thanks. How do you suggest I use the reference population? Sorry, I'm new to R and just don't see it. If i can get a plot that is counts or density relative to my reference data it would be ideal. On Mon, Feb 6, 2012 at 1:12 AM, David Winsemius dwinsem...@comcast.netwrote: On Feb 5, 2012,

Re: [R] histogram

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 12:23 PM, Francis Keyes wrote: Thanks. How do you suggest I use the reference population? Sorry, I'm new to R and just don't see it. If i can get a plot that is counts or density relative to my reference data it would be ideal. It is difficult to specify how when we

Re: [R] histogram

2012-02-06 Thread Francis Keyes
Hi David, I have 2 tables, each with several columns and rows of data. I am only interested in the data from column 6, which contains values in the range -PI to PI. I want to plot the data from tableD with the y axis denoting percentage with respect to tableR. So if data points in the break 2

Re: [R] histogram

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 5:26 PM, Francis Keyes wrote: Hi David, I have 2 tables, each with several columns and rows of data. I am only interested in the data from column 6, which contains values in the range -PI to PI. I want to plot the data from tableD with the y axis denoting percentage with

Re: [R] histogram

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 9:46 PM, Francis Keyes wrote: ok here are two 1-column data files. sample1 and sampleRef (the reference distribution) dat1 - read.table(file=~/Downloads/sample1) datRef - read.table(file=~/Downloads/sampleRef) str(dat1) 'data.frame': 11378 obs. of 1 variable: $

[R] histogram

2012-02-05 Thread Francis Keyes
With R and the hist function, is there a way to make a histogram in which the y axis denotes propotion with respect to a separate sample dataset of the same range instead of frequency? [[alternative HTML version deleted]] __

Re: [R] histogram

2012-02-05 Thread David Winsemius
On Feb 5, 2012, at 8:31 PM, Francis Keyes wrote: With R and the hist function, is there a way to make a histogram in which the y axis denotes propotion with respect to a separate sample dataset of the same range instead of frequency? hist() returns an object with both counts and density.

[R] Histogram: plot by group

2012-01-03 Thread Layo909
I want to make a histogram in R of the data in attached excel file called 'cbt'. However, I need the histogram to show a separation for Group 1 and Group 2, as in attached image. How do I do this in R? I know how to make a histogram for a single group, but how can I separate the 2 groups?

Re: [R] Histogram: plot by group

2012-01-03 Thread ONKELINX, Thierry
januari 2012 8:58 Aan: r-help@r-project.org Onderwerp: [R] Histogram: plot by group I want to make a histogram in R of the data in attached excel file called 'cbt'. However, I need the histogram to show a separation for Group 1 and Group 2, as in attached image. How do I do this in R? I know how

Re: [R] Histogram: plot by group

2012-01-03 Thread Jim Lemon
I want to make a histogram in R of the data in attached excel file called 'cbt'. However, I need the histogram to show a separation for Group 1 and Group 2, as in attached image. How do I do this in R? I know how to make a histogram for a single group, but how can I separate the 2 groups?

Re: [R] Histogram omitting/collapsing groups

2012-01-01 Thread peter dalgaard
On Jan 1, 2012, at 07:40 , Joshua Wiley wrote: If you just want a plot of the frequencies at each hour why not just call barplot on the output of table? Histograms create bins and count in those, which doesn't sound like what you're after. Exactly. If what you want is a barplot, make a

Re: [R] Histogram omitting/collapsing groups

2012-01-01 Thread Aren Cambre
On Sun, Jan 1, 2012 at 5:29 AM, peter dalgaard pda...@gmail.com wrote: Exactly. If what you want is a barplot, make a barplot; histograms are for continuous data.   Just remember that you may need to set the levels explicitly in case of empty groups: barplot(table(factor(x,levels=0:23))).

Re: [R] Histogram omitting/collapsing groups

2012-01-01 Thread Joshua Wiley
Hi Aren, I was busy thinking about how to make what you wanted, and I missed that you were working with hours from a day. That being the case, you may think about a circular graph. The attached plots show two different ways of working with the same data. Cheers, Josh set.seed(10) x -

Re: [R] Histogram omitting/collapsing groups

2012-01-01 Thread Aren Cambre
This is helpful, although I can't seem to adapt it to my own data. If I run your sample as is, I do get the nice graphs. However, this doesn't work: (Assume you already have a data frame dallas with 2057980 rows. It has column offense_hour, and each row has a value between 0 and 23, inclusive.)

Re: [R] Histogram omitting/collapsing groups

2012-01-01 Thread Joshua Wiley
Sorry, that was probably a really confusing example...too many xs floating around. set.seed(10) rawdata - sample(0:23, 1, TRUE, prob = sin(0:23)+1) ## do theis step first for your data tableddata - as.data.frame(table(rawdata)) ## use these names in ggplot colnames(tableddata)

Re: [R] Histogram omitting/collapsing groups

2012-01-01 Thread Aren Cambre
Thanks. That did it! And I get it now--in your original example, aes(x = x, y = Freq), x refers to the column name in as.data.frame(table(x)), not the x vector(?) you created. Aren On Sun, Jan 1, 2012 at 4:44 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: Sorry, that was probably a really

[R] Histogram omitting/collapsing groups

2011-12-31 Thread Aren Cambre
I have two large datasets (156K and 2.06M records). Each row has the hour that an event happened, represented by an integer from 0 to 23. R's histogram is combining some data. Here's the command I ran to get the histogram: histinfo - hist(crashes$hour, right=FALSE) Here's histinfo: histinfo

Re: [R] Histogram omitting/collapsing groups

2011-12-31 Thread Sarah Goslee
Hi, I think you're not understanding quite what's going on with hist. Reread the help, and take a look at this small example. The solution I'd use is the last item. x - rep(1:10, times=1:10) table(x) x 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 hist(x, plot=FALSE,

Re: [R] Histogram omitting/collapsing groups

2011-12-31 Thread jim holtman
Here is a test I ran and looks fine, but then I created the data, so it might have something to do with your data: x - sample(0:23, 10, TRUE) a - hist(x, breaks = 24) a[1:5] $breaks [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 $counts [1] 8262 4114 4186

Re: [R] Histogram omitting/collapsing groups

2011-12-31 Thread jim holtman
Fast fingers; notice that there is still a problem in the counts; I was only looking at the last. Happy New Year -- up too late. On Sun, Jan 1, 2012 at 12:33 AM, jim holtman jholt...@gmail.com wrote: Here is a test I ran and looks fine, but then I created the data, so it might have something

Re: [R] Histogram omitting/collapsing groups

2011-12-31 Thread Joshua Wiley
If you just want a plot of the frequencies at each hour why not just call barplot on the output of table? Histograms create bins and count in those, which doesn't sound like what you're after. Cheers, Josh On Dec 31, 2011, at 21:37, jim holtman jholt...@gmail.com wrote: Fast fingers;

[R] Histogram for each ID value

2011-10-17 Thread a217
I have a dataframe in the general format: chr1 0.5 chr1 0 chr1 0.75 chr2 0 chr2 0 chr3 1 chr3 1 chr3 0.5 chr7 0.75 chr9 1 chr9 1 chr22 0.5 chr22 0.5 where the first column is the chromosome location and the second column is some value. What I'd like to do is have a histogram created for each chr

Re: [R] Histogram for each ID value

2011-10-17 Thread Sarah Goslee
Hi, On Mon, Oct 17, 2011 at 8:07 AM, a217 aj...@case.edu wrote: I have a dataframe in the general format: chr1 0.5 chr1 0 chr1 0.75 chr2 0 chr2 0 chr3 1 chr3 1 chr3 0.5 chr7 0.75 chr9 1 chr9 1 chr22 0.5 chr22 0.5 Using dput to give us some reproducible data would be even better.

Re: [R] Histogram for each ID value

2011-10-17 Thread Paul Hiemstra
Hi, When using ggplot, take a look at facet_wrap and geom_histogram. regards, Paul On 10/17/2011 12:14 PM, Sarah Goslee wrote: Hi, On Mon, Oct 17, 2011 at 8:07 AM, a217 aj...@case.edu wrote: I have a dataframe in the general format: chr1 0.5 chr1 0 chr1 0.75 chr2 0 chr2 0 chr3 1

Re: [R] Histogram for each ID value

2011-10-17 Thread Ben Bolker
Paul Hiemstra paul.hiemstra at knmi.nl writes: Hi, When using ggplot, take a look at facet_wrap and geom_histogram. regards, More specifically, try something along the lines of d - data.frame(f=factor(paste(chr,rep(c(1,2,3,7,9,22),each=50),sep=)), v=runif(300)) library(ggplot2)

Re: [R] Histogram for each ID value

2011-10-17 Thread R. Michael Weylandt
Like others have suggested, I think ggplot2 is probably the best way to go about this, but if you'd rather use base graphics (and you never indicated how you felt about ggplot2), you could do something like this with tapply: fcts - letters[sample(9,1500,T)] vals - rnorm(1500) df -

Re: [R] Histogram for each ID value

2011-10-17 Thread Philipp Pagel
where the first column is the chromosome location and the second column is some value. What I'd like to do is have a histogram created for each chr location (i.e. a separate histogram for chr1, chr2, chr3, chr7, chr9, and chr22). I am just having a hard time getting everything to work out

[R] Histogram messed up

2011-09-06 Thread Berry Boessenkool
Hey all, I encountered a problem drawing a histogram. You can view the picture here: http://dl.dropbox.com/u/4836866/Bad_Histogramm.png What happens: the bars are drawn with different starting points, thus no straight zero-line is there. And bars are overlapping. (or sometimes apart from

Re: [R] Histogram messed up

2011-09-06 Thread Duncan Murdoch
On 11-09-06 6:29 PM, Berry Boessenkool wrote: Hey all, I encountered a problem drawing a histogram. You can view the picture here: http://dl.dropbox.com/u/4836866/Bad_Histogramm.png This has been fixed in R-patched: see https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14628. Duncan

[R] [r] histogram with mean for every break

2011-08-23 Thread Francesco Nutini
Dear R-users, I need to produce a histogram where for every breaks there are the mean of the data. I tried tu use the function hist(x, break=20 ... ) but this return the numerosity for every breaks, not the mean. Any hint? Thanks in advance, francesco

Re: [R] [r] histogram with mean for every break

2011-08-23 Thread R. Michael Weylandt
I do not believe your code (minimal as it is) would work: the correct argument is breaks. More generally, do you really mean to say that hist(x, breaks = 20) immediately returns the bin counts? It doesn't on my machine and if you knew how to get the counts, you should be able to get the midpoints

Re: [R] [r] histogram with mean for every break

2011-08-23 Thread Francesco Nutini
1447.518 1553.838 1649.231 1735.217 1850.617 1957.85 2031.329 2156.8 2247.55 2340.6 2822.1 Thank you very much. francesco From: michael.weyla...@gmail.com Date: Tue, 23 Aug 2011 11:27:13 -0400 Subject: Re: [R] [r] histogram with mean for every break To: nutini.france

Re: [R] Histogram from frequency data in pre-made bins

2011-08-22 Thread RobinLovelace
Update: I have recreated an artificial distribution using uniform random numbers n - c(runif(Car[1],0,2), runif(Car[2],2,5),runif(Car[3],5,10), runif(Car[4],10,20), runif(Car[5],20,30), runif(Car[6],30,40), runif(Car[7],40,60), runif(Car[8],60,200) ) The resulting density

[R] Histogram from frequency data in pre-made bins

2011-08-21 Thread RobinLovelace
Dear R user, I am using UK census data on travel to work. The authorities have provided a breakdown in each area by mode (car, bicycle etc.) and distance travelled (0 – 2 km, 2 – 5 km etc). Therefore, after processing, the data for Sheffield look like this

[R] histogram not equal to Kolmogorov-Smirnov test; 3-way-nested Anova

2011-08-08 Thread Jörg Stephan
Hello R-Help-Team, I am doing a 3-way-nestedAnova and a very strange thing occurred. My Two-sample Kolmogorov-Smirnov test (p=0.957) meet the requirement of normal distribution, BUT if I have a look at the histogram it is definitely not normally distributed. I never had something like that

Re: [R] histogram not equal to Kolmogorov-Smirnov test; 3-way-nested Anova

2011-08-08 Thread David Winsemius
On Aug 8, 2011, at 8:04 AM, Jörg Stephan wrote: Hello R-Help-Team, I am doing a 3-way-nestedAnova and a very strange thing occurred. My Two-sample Kolmogorov-Smirnov test (p=0.957) meet the requirement of normal distribution, BUT if I have a look at the histogram it is definitely not

[R] histogram not equal to Kolmogorov-Smirnov test; 3-way-nested Anova (2)

2011-08-08 Thread Jörg Stephan
Hello R-Help-Team, I am doing a 3-way-nestedAnova and a very strange thing occurred. My Two-sample Kolmogorov-Smirnov test (p=0.957) meet the requirement of normal distribution, BUT if I have a look at the histogram it is definitely not normally distributed. I never had something like that

Re: [R] histogram not equal to Kolmogorov-Smirnov test; 3-way-nested Anova (2)

2011-08-08 Thread David Winsemius
On Aug 8, 2011, at 10:00 AM, Jörg Stephan wrote: Hello R-Help-Team, I am doing a 3-way-nestedAnova and a very strange thing occurred. My Two-sample Kolmogorov-Smirnov test (p=0.957) meet the requirement of normal distribution, BUT if I have a look at the histogram it is definitely not

Re: [R] histogram not equal to Kolmogorov-Smirnov test; 3-way-nested Anova (2)

2011-08-08 Thread Dennis Murphy
Hi: What is the connection between genot and cage? What is the purpose of the levels fifteen, nine and fortyfive in eggs? Are these the numbers of eggs per some type of batch whose total is 45? Dennis On Mon, Aug 8, 2011 at 7:00 AM, Jörg Stephan jogstep...@googlemail.com wrote: Hello

[R] Histogram of a dataframe subset failing

2011-07-24 Thread DimmestLemming
Like most help forum users, I'm very new to R. I've been having this problem: I started with a dataframe called fullData. With the subset command, I split it into two separate dataframes, soloData and teamData. The hist() function works when I use... hist( subset(fullData,

Re: [R] Histogram of a dataframe subset failing

2011-07-24 Thread Dieter Menne
DimmestLemming wrote: hist(soloData$deaths) I get the error, invalid number of 'breaks' . Try str(soloData$deaths) or head(soloData$deaths) or summary(soloData$Death) There may be something wrong with you data. Dieter -- View this message in context:

Re: [R] Histogram of a dataframe subset failing

2011-07-24 Thread DimmestLemming
Thanks! It was late, so this didn't occur to me, but I tried summary() and all values were NA. The subset had resulted in a dataframe with 0 rows somehow, but now that's fixed. -- View this message in context:

Re: [R] Histogram

2011-06-09 Thread Rolf Turner
On 09/06/11 16:39, nandini_bn wrote: Hi Sam,This is exactly what I wanted. Could you please explain the code ? what does 15, 0.65 and 0.25 stand for ?Nandini Date: Wed, 8 Jun 2011 15:16:45 -0700 From: ml-node+3583766-897200094-233...@n4.nabble.com To: nandini...@hotmail.com Subject: Re:

Re: [R] Histogram

2011-06-09 Thread Anupam
this? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Kennedy Sent: Thursday, June 09, 2011 3:28 AM To: nandini_bn Cc: r-help@r-project.org Subject: Re: [R] Histogram Have a look at: http://addictedtor.free.fr/graphiques/thumbs.php

Re: [R] Histogram

2011-06-09 Thread R Help
: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Kennedy Sent: Thursday, June 09, 2011 3:28 AM To: nandini_bn Cc: r-help@r-project.org Subject: Re: [R] Histogram Have a look at: http://addictedtor.free.fr/graphiques/thumbs.php One of the graph

Re: [R] Histogram

2011-06-09 Thread R Help
, This is exactly what I wanted. Could you please explain the code ? what does 15, 0.65 and 0.25 stand for ? Nandini Date: Wed, 8 Jun 2011 19:16:06 -0300 Subject: Re: [R] Histogram From: rhelp.st...@gmail.com To: nandini...@hotmail.com CC: r-help@r-project.org I think the command you

Re: [R] Histogram

2011-06-09 Thread Anupam
] Sent: Thursday, June 09, 2011 5:58 PM To: Anupam Cc: Steven Kennedy; r-help@r-project.org Subject: Re: [R] Histogram It's difficult to understand what exactly you're looking for without seeing an example, could you post a simple version? imgur.com is a website that lets you quickly upload

[R] histogram - density on y axis and restriction to interval [0, 1]

2011-06-09 Thread Christine SINOQUET
Hello, To indicate probability densities instead of counts on a histogram, I specify freq = FALSE. However, I expect that summing all top y coordinates over all the intervals of the histogram will provide 1. 1) v - c(0.2885, 0.2988, 0.3139, 0.2615, 0.3179, 0.3163, 0.2583, 0.3052, 0.2527,

Re: [R] histogram - density on y axis and restriction to interval [0, 1]

2011-06-09 Thread Sarah Goslee
Did you read the help for hist? freq: logical; if ‘TRUE’, the histogram graphic is a representation of frequencies, the ‘counts’ component of the result; if ‘FALSE’, probability densities, component ‘density’, are plotted (so that the histogram has a total area

[R] Histogram

2011-06-08 Thread nandini_bn
Hello , I am trying to create a histogram in order to compare between two groups and would like it to be similar to the figure attached. How can I generate this using R ? Thank you, Nandini http://r.789695.n4.nabble.com/file/n3582448/5634-15977-1-PB.gif -- View this message in context:

[R] histogram help

2011-06-08 Thread Nandini B
Hello , I am trying to create a histogram in order to compare between two groups and would like it to be similar to the figure attached. How can I generate this using R ? Thank you, Nandini __

Re: [R] Histogram

2011-06-08 Thread R Help
I think the command you want is barplot x = rbinom(10,15,0.65) y = rbinom(10,15,0.25) barplot(rbind(x,y),beside=TRUE) Sam On Wed, Jun 8, 2011 at 10:14 AM, nandini_bn nandini...@hotmail.com wrote: Hello , I am trying to create a histogram in order to compare between two groups and would

Re: [R] Histogram

2011-06-08 Thread Steven Kennedy
Have a look at: http://addictedtor.free.fr/graphiques/thumbs.php One of the graph examples they have is exactly what you are after. On Wed, Jun 8, 2011 at 11:14 PM, nandini_bn nandini...@hotmail.com wrote: Hello , I am trying to create a histogram in order to compare between two groups and

Re: [R] Histogram

2011-06-08 Thread nandini_bn
Hi Sam,This is exactly what I wanted. Could you please explain the code ? what does 15, 0.65 and 0.25 stand for ?Nandini Date: Wed, 8 Jun 2011 15:16:45 -0700 From: ml-node+3583766-897200094-233...@n4.nabble.com To: nandini...@hotmail.com Subject: Re: Histogram I think the command

Re: [R] histogram with density

2011-05-24 Thread Steve Lianoglou
On Tue, May 24, 2011 at 12:31 AM, Rekha chithralekh...@gmail.com wrote: S . Am getting error still now if i use both version of the codes . i have to call any library? No. The code you've written here doesn't require loading any other R libraries. Please copy and paste the exact code you've

Re: [R] histogram with density

2011-05-24 Thread Peter Ehlers
On 2011-05-23 21:31, Rekha wrote: S . Am getting error still now if i use both version of the codes . i have to call any library? Your code works fine for me, too, as it should. Have you perhaps redefined the hist() function? Do you get a histogram? The error you quote would result if you

[R] histogram with density

2011-05-23 Thread Rekha
Hello All,* *I want to draw a histogram with density curve. * *For that simply i created a data called*x *and i used the function called *hist(x, col = blue, freq = FALSE),** *from this function i got a histogram*. *After that , i tried this function* ** lines(density(x), col = red, lwd

Re: [R] histogram with density

2011-05-23 Thread Steve Lianoglou
Hi, On Mon, May 23, 2011 at 11:41 PM, Rekha chithralekh...@gmail.com wrote: Hello All,* *I want to draw a histogram with density curve. * *For that simply i created a data called*x *and i used the function called *    hist(x, col = blue, freq = FALSE),**   *from this function i got a

Re: [R] histogram with density

2011-05-23 Thread Rekha
S . Am getting error still now if i use both version of the codes . i have to call any library? On Tue, May 24, 2011 at 9:22 AM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Mon, May 23, 2011 at 11:41 PM, Rekha chithralekh...@gmail.com wrote: Hello All,* *I want to

[R] histogram of dates

2011-04-22 Thread Terry Therneau
I can't seem to get a histogram of dates: tmt910% R --vanilla R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 ... temp - as.Date(1:200, origin=1970/01/01) range(temp) [1] 1970-01-02 1970-07-20 hist(temp) Error in

Re: [R] histogram of dates

2011-04-22 Thread Marc Schwartz
On Apr 22, 2011, at 12:31 PM, Terry Therneau wrote: I can't seem to get a histogram of dates: tmt910% R --vanilla R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 ... temp - as.Date(1:200, origin=1970/01/01) range(temp)

[R] Histogram with two groups on the same graph (not on separate panels)

2010-07-15 Thread Kiyoshi Sasaki
I have been trying to produce a histogram that has two groups (male and female snakes) on the same graph (either superimposed or each frequency bar appears side by side). I found a couple of functions for superimposed histogram written by other people. The below is the codes I used for my data

[R] Histogram Principal component analysis in R

2010-07-08 Thread DHIMAN BHADRA
Hi, I am trying to do a Principal component analysis on histogram data. Basically, I have a group of subjects and for each of them, I have a column of bin-counts (vis-a-vis intervals) and a corresponding column of frequencies (or normalized frequencies). The bin counts are the same for all the

Re: [R] Histogram Principal component analysis in R

2010-07-08 Thread Tal Galili
Hello Dhiman , I have never tried doing it on such data, so I am not sure how this methodology applies or what covets it may hold. However, R wise, it sounds to me like simply reusing the code here: http://www.statmethods.net/advstats/factor.html Would do the trick. p.s: you wrote It would be

[R] Histogram Bin

2010-05-14 Thread Research
Hello, Is there a function that returns the number of the bin (or quantile, or percentile etc. etc.) that a value of a variable may belong to? Tor example: breaks-hist(variable, 18, plot=FALSE) If the following breaks are 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 the boundaries

Re: [R] Histogram Bin

2010-05-14 Thread Robert A LaBudde
x- rnorm(200) hist(x, 18) str(hist(x, 18)) List of 7 $ breaks : num [1:15] -3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 ... $ counts : int [1:14] 3 1 8 12 34 35 40 30 18 11 ... $ intensities: num [1:14] 0.03 0.01 0.08 0.12 0.34 ... $ density: num [1:14] 0.03 0.01 0.08 0.12 0.34 ... $

Re: [R] Histogram Bin

2010-05-14 Thread Sean Anderson
On Fri, May 14, 2010 at 10:55 AM, Research risk2...@ath.forthnet.gr wrote: Is there a function that returns the number of the bin (or quantile, or percentile etc. etc.) that a value of a variable may belong to? Something like this should work: dat - round(runif(20, 0, 100)) hist.dat -

Re: [R] Histogram Bin

2010-05-14 Thread David Winsemius
On May 14, 2010, at 9:55 AM, Research wrote: Hello, Is there a function that returns the number of the bin (or quantile, or percentile etc. etc.) that a value of a variable may belong to? Tor example: breaks-hist(variable, 18, plot=FALSE) If the following breaks are 5 10 15 20 25 30

Re: [R] Histogram not plotting correct breaks

2010-04-27 Thread Uwe Ligges
On 27.04.2010 07:26, Tal Galili wrote: trying setting br = 40 inside the hist, and check if that helps... (breaks won't do it for you either way) Tal No, the main problem is that a hist()ogram is used rather than a barplot() which should be used Uwe Ligges

Re: [R] Histogram not plotting correct breaks

2010-04-27 Thread Greg Snow
-project.org Subject: [R] Histogram not plotting correct breaks Hi, I'm using the hist function to plot the frequency of 21 variables, but it keeps starting the x-axis from 0 and adding variables 1 and 2 together (all other vairables have the correct frequencies). I suspect it adds 1 and 2

[R] Histogram not plotting correct breaks

2010-04-26 Thread burgundy
Hi, I'm using the hist function to plot the frequency of 21 variables, but it keeps starting the x-axis from 0 and adding variables 1 and 2 together (all other vairables have the correct frequencies). I suspect it adds 1 and 2 together so that 0 can fit in with demarcations at intervals of 5.

Re: [R] Histogram not plotting correct breaks

2010-04-26 Thread Tal Galili
trying setting br = 40 inside the hist, and check if that helps... (breaks won't do it for you either way) Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) |

[R] histogram breaks

2010-04-16 Thread casperyc
=== Q2=c( + sample(10:19,8,T), + sample(20:24,15,T), + sample(25:29,25,T), + sample(30:39,18,T), + sample(40:49,12,T), + sample(50:64,7,T), + sample(65:89,5,T) + ) hist(Q2) can give me a histogram, however, how do i get a different

Re: [R] histogram breaks

2010-04-16 Thread Daniel Malter
Subject: [R] histogram breaks === Q2=c( + sample(10:19,8,T), + sample(20:24,15,T), + sample(25:29,25,T), + sample(30:39,18,T), + sample(40:49,12,T), + sample(50:64,7,T), + sample(65:89,5,T) + ) hist(Q2) can give me a histogram, however, how

Re: [R] histogram

2010-04-15 Thread Paul Hiemstra
Santosh wrote: Dear R gurus... How do I control smoothing of a density plot in panel.densityplot when using histogram? Thanks much, Santosh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] histogram

2010-04-15 Thread Santosh
Thanks for your email... yes, I had tried that bw thing.. for some reason it does not seem to work.. could not figure out where I am wrong... Below is an example for your convenience.. you might notice that the density plots appear to be a curve of connected segments. Changing breaks, nint or bw

Re: [R] histogram

2010-04-15 Thread Paul Hiemstra
Santosh wrote: Thanks for your email... yes, I had tried that bw thing.. for some reason it does not seem to work.. could not figure out where I am wrong... Below is an example for your convenience.. you might notice that the density plots appear to be a curve of connected segments. Changing

Re: [R] histogram

2010-04-15 Thread Peter Ehlers
On 2010-04-15 3:35, Santosh wrote: Thanks for your email... yes, I had tried that bw thing.. for some reason it does not seem to work.. could not figure out where I am wrong... Below is an example for your convenience.. you might notice that the density plots appear to be a curve of connected

Re: [R] histogram

2010-04-15 Thread Santosh
yes.. that now works! thank you so much, Paul Peter!! -santosh On Thu, Apr 15, 2010 at 3:11 AM, Paul Hiemstra p.hiems...@geo.uu.nl wrote: Santosh wrote: Thanks for your email... yes, I had tried that bw thing.. for some reason it does not seem to work.. could not figure out where I am

[R] histogram

2010-04-14 Thread Santosh
Dear R gurus... How do I control smoothing of a density plot in panel.densityplot when using histogram? Thanks much, Santosh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] histogram-like barplot? (or reverse?)

2010-04-03 Thread Nick Matzke
Hi, I have a simple task I can't figure out. I'd like to take some measurements I made, e.g.: year (y-axis) 1 2 3 4 5 6 counts (x-axis) 10 10 20 30 40 50 And then, make a barplot with the x-axis ticks (representing the borders between years) between the bars. However, barplot seems to

Re: [R] histogram-like barplot? (or reverse?)

2010-04-03 Thread Bob O'Hara
Hi, Nick! plot(.., type=h, lwd=5, lend=3, xaxt=n) axis(1, at=c(...)) is the way to start, after which you play with the code. For years. Bob On 3 April 2010 21:52, Nick Matzke mat...@berkeley.edu wrote: Hi, I have a simple task I can't figure out. I'd like to take some measurements I

Re: [R] histogram-like barplot? (or reverse?)

2010-04-03 Thread Kjetil Halvorsen
It might work to just say barplot(table(...)) Kjetil CC Or maybe even plot(table(...)) On Sat, Apr 3, 2010 at 5:14 PM, Bob O'Hara rni@gmail.com wrote: Hi, Nick! plot(.., type=h, lwd=5, lend=3, xaxt=n) axis(1, at=c(...)) is the way to start, after which you play with the code.

Re: [R] histogram-like barplot? (or reverse?)

2010-04-03 Thread Nick Matzke
Nevermind, I think I got it: tempdata = data.frame(cbind(x,y)) xyplot(y ~ x, data=tempdata, xlab=xlabel, ylab=ylabel, xlim=c(1.05* min(timebins), 0), horizontal=FALSE, col=gray, scales=list(alternating=FALSE, tck=c(1,0), x=list(at=timebins, labels=timebins)),

[R] Histogram color

2010-03-04 Thread Ashta
In a histogram , is it possible to have different colors? Example. I generated x - rnorm(100) hist(x) I want the histogram to have different colors based on the following condition mean(x)+sd(x) with red color and mean(x) - sd(x) with red color as well. The middle one with blue color.

Re: [R] Histogram color

2010-03-04 Thread David Winsemius
On Mar 4, 2010, at 7:41 AM, Ashta wrote: In a histogram , is it possible to have different colors? Example. I generated x - rnorm(100) hist(x) I want the histogram to have different colors based on the following condition mean(x)+sd(x) with red color and mean(x) - sd(x) with red

Re: [R] Histogram color

2010-03-04 Thread Greg Snow
. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Ashta Sent: Thursday, March 04, 2010 5:42 AM To: R help Subject: [R] Histogram color

[R] histogram scott

2010-02-05 Thread maram salem
Dear all, I want to use the histogtam as a density estimator, with the binwidths calculated using scott's formula which is binwidth = 3.49*ST.dev.*n^(-1/3) for the following data  (30 data points) 12-9-3-6-1-23-21-7-18-16-15-4-19-22-20-2-3-18-8-10-1-7-5-4-11-12-3-9-19-7 so first,I' ve tried this

Re: [R] histogram scott

2010-02-05 Thread Duncan Murdoch
On 05/02/2010 12:21 PM, maram salem wrote: Dear all, I want to use the histogtam as a density estimator, with the binwidths calculated using scott's formula which is binwidth = 3.49*ST.dev.*n^(-1/3) for the following data (30 data points)

Re: [R] Histogram function from lattice package

2010-02-04 Thread Peter Ehlers
Is this what you want: singer1 - subset(singer, voice.part == Bass 1) brks - seq(65, 75, 2) histogram( ~ height, data = singer1, breaks = brks) or, slightly different: histogram( ~ height, data = singer1, breaks = brks, scales = list(x = list(at = brks))) -Peter Ehlers anna wrote:

[R] Histogram function from lattice package

2010-02-03 Thread anna
Hello everyone, does anyone have an idea of how I display the breakpoints on the x label when using the histogram funtion from lattice? - Anna Lippel -- View this message in context: http://n4.nabble.com/Histogram-function-from-lattice-package-tp1461735p1461735.html Sent from the R help

Re: [R] Histogram/BoxPlot Panel

2009-12-30 Thread Lorenzo Isella
Dear Baptiste, Thanks a lot for the excellent example, which convinced me to start studying ggplot2. A trivial question: is there an easy way to generate a boxplot without outliers? Using R standard plotting facilities, this amounts to giving outline=FALSE within boxplot. Can I easily achieve

[R] Histogram/BoxPlot Panel

2009-12-29 Thread Lorenzo Isella
Dear All, I am given 15 different data sets and I would like to generate a panel showing all of them. Each dataset will be presented either as a boxplot or as a histogram. There are several possible ways to achieve this (as far as I know) (1) using plot and mfrow() (2) using lattice (3) using

Re: [R] Histogram/BoxPlot Panel

2009-12-29 Thread baptiste auguie
Hi, Here is some artificial data followed by minimal ggplot2 and lattice examples, makeUpData - function(){ data.frame(x=sample(letters[1:4], 100, repl=TRUE), y=rnorm(100)) } datasets - replicate(15, makeUpData(), simplify=FALSE) names(datasets) - paste(dataset, seq_along(datasets), sep=)

Re: [R] Histogram/BoxPlot Panel

2009-12-29 Thread baptiste auguie
I forgot the base graphics way, ## divide the window in 4x4 cells par(mfrow=n2mfrow(length(datasets))) ## loop over the list of datasets and plot each one be.quiet - lapply(datasets, function(ii) boxplot(y~x, data=ii)) ggplot2 has a website with many examples, http://had.co.nz/ggplot2/ as well

<    1   2   3   4   >