Re: [R] HISTOGRAM

2018-11-10 Thread Medic
Rui Barradas, thank you for your prompt response, your code will be useful to me in the future! Rick Bilonick ("your data appear to be categorical"), thank you very much for your comment (I would have to more correctly express my task). JIM Lemon, THANKS!!! THIS IS EXACTLY what I needed!

Re: [R] HISTOGRAM

2018-11-10 Thread Jim Lemon
Hi Medic, Perhaps this: medic_df<-read.table(text="name number ds6277 lk 24375 ax46049 dd70656 az216544 df 220620 gh641827", header=TRUE) library(plotrix) options(scipen=10) barp(medic_df$number,names.arg=medic_df$name,width=0.5) As others have noted, this is really a

Re: [R] HISTOGRAM

2018-11-09 Thread Rick Bilonick
First, a histogram would not be appropriate (your data appear to be categorical - a histogram is for continuous numeric vales) - you would need a bar plot. You should make two vectors (one for the category names and the other for the frequencies) and use the barplot function. On Fri, Nov 9, 2018

Re: [R] HISTOGRAM

2018-11-09 Thread Rui Barradas
Hello, You probably want a bar plot, not a histogram. old.sci <- options(scipen=999) with(mydata, barplot(number, space = 0, names.arg = name, beside = TRUE)) options(scipen = old.sci) #- mydata <- read.table(text = " name number ds6277 lk 24375 ax46049 dd

[R] HISTOGRAM

2018-11-09 Thread Medic
What would be the correct code (simplest version) (without gplot()) for histogram (with 7 bars), which would include 7 names of bars under the X-axis. The data are: name number ds6277 lk 24375 ax46049 dd70656 az216544 df 220620 gh641827 (I'm attaching mydata.r, making

Re: [R] histogram in GNU R....

2018-09-07 Thread Peter Langfelder
A simpler short term solution is to execute dev.off() and look for the plot in file Rplots.pdf in the current directory. Depending on the OS of the local computer, you should be able to point a file browser at the EC instance and simply click the file to open in in a pdf viewer on the local

Re: [R] histogram in GNU R....

2018-09-07 Thread William Dunlap via R-help
You may have to install X11 stuff to your ec2 instance. E.g., googling for "ec2 X11 forwarding" showed things like the following: Re: X11 forwarding to access AWS EC2 Linux instance Posted by: wilderfield Posted on: Apr 5, 2018 11:31 AM

Re: [R] histogram in GNU R....

2018-09-07 Thread MacQueen, Don via R-help
In addition to the other suggestions, try typing x11() before using hist(). That *should* start a graphics window. If it does not, then type capabilities() and see if "X11" is TRUE. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550

Re: [R] histogram in GNU R....

2018-09-07 Thread peter dalgaard
You are most likely plotting to a non-screen device. Check dev.list() after the hist(), and then the documentation for that device. It's probably pdf, and after quitting R, you should find that a file Rplots.pdf has been created. -pd > On 7 Sep 2018, at 10:26 , akshay kulkarni wrote: > >

Re: [R] histogram in GNU R....

2018-09-07 Thread Ivan Krylov
On Fri, 7 Sep 2018 08:26:22 + akshay kulkarni wrote: > when I type hist(xht), it goes to the next prompt. More importantly, > there is no error message. So, the most probable conclusion is that > the command gets executed Yes, hist() returns its value invisibly (try typing "? invisible" in

Re: [R] Histogram of character elements

2018-06-07 Thread Luigi Marongiu
Thank you Ben, this also works! I have a copy of the Sarkar but, usually, I don't work with histograms. I'll brush it up, then. Best regards, Luigi On Thu, Jun 7, 2018 at 1:43 PM Ben Tupper wrote: > > Hi again, > > I'm sort of pre-coffee still, but does this do it? The data frame only has >

Re: [R] Histogram of character elements

2018-06-07 Thread Ben Tupper
Hi again, I'm sort of pre-coffee still, but does this do it? The data frame only has one variable, a factor where the order of the levels is specified. library(lattice) group <- c("a", "b", "c", "d", "e") freq<- c(1, 2, 2, 5, 3) x <- rep(group, freq) df <- data.frame(group =

Re: [R] Histogram of character elements

2018-06-07 Thread Luigi Marongiu
also, with this approach, I need to re-arrange the data. Is it possible to work directly on a dataframe? On Thu, Jun 7, 2018 at 12:48 PM Ben Tupper wrote: > > Hi, > > Is this what you are after? > > group <- c("a", "b", "c", "d", "e") > freq <-c(1, 2, 2, 5, 3) > x = rep(group, freq) >

Re: [R] Histogram of character elements

2018-06-07 Thread Luigi Marongiu
exactly! Thank you! but it is possible to do it with lattice? I might have an extra level of information, for instance super-group, and in that case, I could plot all the supergroup easily together. On Thu, Jun 7, 2018 at 12:48 PM Ben Tupper wrote: > > Hi, > > Is this what you are after? > >

Re: [R] Histogram of character elements

2018-06-07 Thread Ben Tupper
Hi, Is this what you are after? group <- c("a", "b", "c", "d", "e") freq <-c(1, 2, 2, 5, 3) x = rep(group, freq) barplot(table(x)) Cheers, Ben > On Jun 7, 2018, at 6:00 AM, Luigi Marongiu wrote: > > Dear all, > I have a dataframe with a column representing the names of the > elements (a,

[R] Histogram of character elements

2018-06-07 Thread Luigi Marongiu
Dear all, I have a dataframe with a column representing the names of the elements (a, b, etc) and one with their frequencies. How can I plot the frequencies so that each element has an associated frequency value? I have been thinking of a histogram, but I have found it difficult to implement. I

Re: [R] Histogram plots in Lattice with spatialgrid dataframe data

2017-07-09 Thread Thomas Adams
Jeff, Thank you! I know what I did was very inelegant and I understand about providing a reproducible example; I just could not do it with my data -- I guess I was too lazy to make up a toy one. I apologize about the email formatting. I would never have known to use 'stack', 'levels' 'gather'

Re: [R] Histogram plots in Lattice with spatialgrid dataframe data

2017-07-09 Thread Jeff Newmiller
Glad you found an answer, though it looks more self-educational than efficient (see suggestions below). In the future, follow the recommendations of the Posting Guide: use plain text, and provide a reproducible example. Some elaborations on what "reproducible" means are [1][2][3]. One issue

Re: [R] Histogram plots in Lattice with spatialgrid dataframe data

2017-07-09 Thread Thomas Adams
Hello all, After more digging I was able to find out how to do this. The answer came from an example here: https://stackoverflow.com/questions/3541713/how-to-plot-two-histograms-together-in-r yr_1997<-data.frame(bias=ann_bias$bias1997) yr_1998<-data.frame(bias=ann_bias$bias1998)

[R] Histogram plots in Lattice with spatialgrid dataframe data

2017-07-09 Thread Thomas Adams
Hi all, I can not seem to get what I want using the Lattice package to generate an array of histograms of spatialgrid dataframe data. I can use the sp package and spplot to generate an array of maps that display an array of spatialgrid dataframe data -- that's good. I have:

Re: [R] histogram first bar wrong position

2016-12-23 Thread peter dalgaard
> On 22 Dec 2016, at 18:08 , William Dunlap via R-help > wrote: > > As a practical matter, 'continuous' data must be discretized, so if you > have long vectors of it you will run into this problem. Yep, and it is a bit unfortunate that hist() tries to use "pretty"

Re: [R] histogram first bar wrong position

2016-12-23 Thread Martin Maechler
> William Dunlap > on Thu, 22 Dec 2016 09:08:35 -0800 writes: > As a practical matter, 'continuous' data must be discretized, so if you > have long vectors of it you will run into this problem. > Bill Dunlap > TIBCO Software > wdunlap tibco.com

Re: [R] histogram first bar wrong position

2016-12-22 Thread Ted Harding
Willam has listed the lid on the essence of the problem, which is that in R the way that breaks (and therefore counts) in a histogram are evaluated is an area of long grass with lurking snakes! To get a glimpse of this, have a look at ?hist and in the seaction "Arguments", look at "breaks",

Re: [R] histogram first bar wrong position

2016-12-22 Thread William Dunlap via R-help
As a practical matter, 'continuous' data must be discretized, so if you have long vectors of it you will run into this problem. Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Dec 22, 2016 at 8:19 AM, Martin Maechler wrote: > > itpro >

Re: [R] histogram first bar wrong position

2016-12-22 Thread William Dunlap via R-help
Looking at the return value of hist will show you what is happening: > x <- rep(1:6,10*(6:1)) > z <- hist(x, freq=TRUE) > z $breaks [1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 $counts [1] 60 50 0 40 0 30 0 20 0 10 ... The the first bin is [1-1.5], including both endpoints, while the

Re: [R] histogram first bar wrong position

2016-12-22 Thread Martin Maechler
> itpro > on Thu, 22 Dec 2016 16:17:28 +0300 writes: > Hi, everyone. > I stumbled upon weird histogram behaviour. > Consider this "dice emulator": > Step 1: Generate uniform random array x of size N. > Step 2: Multiply each item by six and

[R] histogram first bar wrong position

2016-12-22 Thread itpro
Hi, everyone. I stumbled upon weird histogram behaviour. Consider this "dice emulator": Step 1: Generate uniform random array x of size N. Step 2: Multiply each item by six and round to next bigger integer to get numbers 1 to 6. Step 3: Plot histogram. > x<-runif(N) > y<-ceiling(x*6) >

Re: [R] Histogram using Sturges' Bining Errors

2016-10-02 Thread Jim Lemon
Hi Elysa, This is pretty much a guess. If you understand the first error, i.e. that there are nine rows in your input data frame (?) that contain NA, NaN, or Inf values, have you tried manually removing those rows and feeding the remainder to your code? Jim On Sun, Oct 2, 2016 at 7:19 PM, Elysa

[R] Histogram using Sturges' Bining Errors

2016-10-02 Thread Elysa Mitova
Histogram using Sturges' bining Hello, I am trying to create a histogram using Sturges' bining rule, yet I keep getting 2 errors, which probably have to do with the variable I am using. Here is my process and the errors, what would you suggest? k <- ggplot (world, aes (x=polstab)) wid <-

Re: [R] Histogram with a wide range of numbers.

2016-01-21 Thread Jim Lemon
Hi Sema, I trimmed your file to the first 220 lines. ads<-read.table("all_data_scor.txt",header=TRUE,sep="\t") ads.tab<-table(cut(all_data_scor[,2],breaks=c(0,1e-100,1e-10,1e-1,1,10))) barplot(adt.tab) This gives you a basic idea of what can be done. If this is not clear, ask again. Jim On

[R] Histogram for Left Censored Data

2015-12-31 Thread Steven Stoline
Dear All: I need helps with creating histograms for data that include left censored observations. Here is an example of left censored data *Sulfate.Concentration*

Re: [R] Histogram for Left Censored Data

2015-12-31 Thread Jim Lemon
Hi Steve, Maybe something like this: Sconc<-matrix(c(1450,1800,1840,1820,1860,1780,1760,1800,1900, 1770,1790,1780,1850,1760,1450,1710,1575,1475,1780,1790, 1780,1450,1790,1800,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0), 24,2) hist(Sconc[,1],breaks=c(1450,1550,1650,1750,1900))

[R] Histogram from a single column of a data frame

2014-09-26 Thread Richard Lerner
Column 7 of oded is Breed. If I enter summary(Breed) I get the counts of the numbers in each breed. However, if I enter I have tried hist($Breed) Error: unexpected '$' in hist($ hist(Breed) Error in hist(Breed) : object 'Breed' not found hist(Breed) Error in hist.default(Breed) : 'x' must

Re: [R] Histogram from a single column of a data frame

2014-09-26 Thread William Dunlap
Try hist(oded$Breed) (I suspect that summary(Breed) does not work in your current session either - perhaps you had a dataset named just Breed or had attached the data.frame oded in the session where summary(Breed) works.) Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Sep 26, 2014 at

Re: [R] Histogram from a single column of a data frame

2014-09-26 Thread Rolf Turner
On 27/09/14 05:57, Richard Lerner wrote: Column 7 of oded is Breed. If I enter summary(Breed) I get the counts of the numbers in each breed. However, if I enter I have tried hist($Breed) Error: unexpected '$' in hist($ hist(Breed) Error in hist(Breed) : object 'Breed' not found

Re: [R] Histogram

2013-09-05 Thread David Carlson
To: dcarl...@tamu.edu Cc: 'philippe massicotte'; 'Rui Barradas'; 'r-help@R-project.org' Subject: Re: [R] Histogram On 13-09-04 4:44 PM, David Carlson wrote: Good question. It turns out that the manual page does not tell the whole story. Do you really think the manual page would be improved

Re: [R] Histogram

2013-09-05 Thread Duncan Murdoch
- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Wednesday, September 4, 2013 7:00 PM To: dcarl...@tamu.edu Cc: 'philippe massicotte'; 'Rui Barradas'; 'r-help@R-project.org' Subject: Re: [R] Histogram On 13-09-04 4:44 PM, David Carlson wrote: Good question. It turns out

[R] Histogram

2013-09-04 Thread philippe massicotte
Hi everyone. I'm currently translating some Matlab code into R. However, I realized that the hsit function produce different results in both languages. in Matlab, hist(1:10, 10) will produce 10 bins with a count of 1 in each, but in R it will produce 9 classes with count of 2,1,1,1,1,1,1,1,1.

Re: [R] Histogram

2013-09-04 Thread David Carlson
-boun...@r-project.org] On Behalf Of philippe massicotte Sent: Wednesday, September 4, 2013 1:34 PM To: r-help@R-project.org Subject: [R] Histogram Hi everyone. I'm currently translating some Matlab code into R. However, I realized that the hsit function produce different results in both languages

Re: [R] Histogram

2013-09-04 Thread Rui Barradas
Hello, See the arguments 'right' and 'include.lowest' of ?hist. To give what you want, try instead h1 - hist(1:10, 10) # counts are 2, 1, 1, ... h2 - hist(1:10, breaks = 0:10) # all counts are 1 and see the difference between h1 and h2, components 'breaks' and 'counts'. Hope this helps,

Re: [R] Histogram

2013-09-04 Thread Duncan Murdoch
Subject: Re: [R] Histogram Hello, See the arguments 'right' and 'include.lowest' of ?hist. To give what you want, try instead h1 - hist(1:10, 10) # counts are 2, 1, 1, ... h2 - hist(1:10, breaks = 0:10) # all counts are 1 and see the difference between h1 and h2, components 'breaks

Re: [R] Histogram

2013-09-04 Thread Ista Zahn
From: ruipbarra...@sapo.pt To: pmassico...@hotmail.com CC: r-help@r-project.org Subject: Re: [R] Histogram Hello, See the arguments 'right' and 'include.lowest' of ?hist. To give what you want, try instead h1 - hist(1:10, 10) # counts are 2, 1, 1, ... h2 - hist(1:10, breaks = 0:10

Re: [R] Histogram

2013-09-04 Thread arun
, 2013 4:02 PM Subject: Re: [R] Histogram Thank you everyone. Try executing this: replicate(100, length(hist(rnorm(100), nclass = 10)$counts)) I'm still not sure why the number of bins (classes) is not consistent. Thank in advance. Date: Wed, 4 Sep 2013 20:27:36 +0100 From: ruipbarra...@sapo.pt

Re: [R] Histogram

2013-09-04 Thread David Carlson
CC: r-help@r-project.org Subject: Re: [R] Histogram Hello, See the arguments 'right' and 'include.lowest' of ?hist. To give what you want, try instead h1 - hist(1:10, 10) # counts are 2, 1, 1, ... h2 - hist(1:10, breaks = 0:10) # all counts are 1 and see the difference between h1

Re: [R] Histogram

2013-09-04 Thread Duncan Murdoch
: Wednesday, September 4, 2013 3:02 PM To: Rui Barradas Cc: r-help@R-project.org Subject: Re: [R] Histogram Thank you everyone. Try executing this: replicate(100, length(hist(rnorm(100), nclass = 10)$counts)) I'm still not sure why the number of bins (classes) is not consistent. Thank

Re: [R] Histogram

2013-09-04 Thread philippe massicotte
Thank you everyone for your help. Date: Wed, 4 Sep 2013 20:00:02 -0400 From: murdoch.dun...@gmail.com To: dcarl...@tamu.edu CC: pmassico...@hotmail.com; ruipbarra...@sapo.pt; r-help@r-project.org Subject: Re: [R] Histogram On 13-09-04 4:44 PM, David Carlson wrote: Good question. It turns

Re: [R] histogram with bars colored according to a vector of values

2013-07-26 Thread Jim Lemon
On 07/26/2013 12:13 PM, john d wrote: Dear all, Let's say I have the following data.frame: dat-data.frame(x=rnorm(100), y=rnorm(100,2)) and I plot a histogram of variable x, somethink like: hist(dat$x, breaks=-5:5) Now, I'd like to color each bar according to the mean of the cases according

[R] histogram with bars colored according to a vector of values

2013-07-25 Thread john d
Dear all, Let's say I have the following data.frame: dat-data.frame(x=rnorm(100), y=rnorm(100,2)) and I plot a histogram of variable x, somethink like: hist(dat$x, breaks=-5:5) Now, I'd like to color each bar according to the mean of the cases according to y. For instance, the color of the bar

[R] Histogram equalization of dataset

2013-03-20 Thread SpaceSeller
I read about histogram equalization of dataset. It is commonly used for image data. It is written: Each variable in dataset is assigned to one bin. Then, each variable in the dataset is assigned to one bin, incrementing the value of that bin by one. Then, a cumulative histogram is created by

Re: [R] histogram

2013-03-05 Thread arun
HI Elisa, Just noticed the order of elements in vec1: You have to replace `vec1` dat2- as.dist(dat1[,-1],upper=F,diag=F) vec1- as.vector(dat2)  head(vec1) #[1]  5.796656 43.523023 38.193750 44.730182  6.511703  2.904954 #the order is based on columns #with dat1-

Re: [R] histogram

2013-03-05 Thread arun
Hi, I guess this is what you wanted. Attaching a plot from a subset (lstSub) dat1- read.csv(rightest.csv,sep=,,header=TRUE,check.names=FALSE) label1=c(0-25,25-50,50-75) Name1-unlist(lapply(0:123,function(i) rep(i+1,i))) dat1New- dat1[,-1] vec1-

Re: [R] histogram

2013-03-04 Thread arun
Hi Elisa, I am not sure about the output you wanted. dat1- read.csv(rightest.csv,sep=,,header=TRUE,check.names=FALSE)  dat2- as.dist(dat1[,-1],upper=F,diag=F) vec1- as.vector(dat2) label1=c(0-25,25-50,50-75) Count1- as.data.frame(table(cut(vec1,breaks=seq(0,75,25),labels=label1))) #Overall count

Re: [R] histogram

2013-03-04 Thread arun
Hi, Sorry, I forgot names(which() Names2-apply(res1,1,function(x) paste(names(which(x!=0)),collapse=,)) res2- data.frame(Frequency=apply(res1,1,function(x) sum(1*(x!=0))), stations=Names2,stringsAsFactors=FALSE)  res2  #     Frequency #0-25    121 #25-50   122 #50-75    76    

Re: [R] histogram

2013-03-04 Thread arun
Hi, dat1- read.csv(rightest.csv,sep=,,header=TRUE,check.names=FALSE)  dat2- as.dist(dat1[,-1],upper=F,diag=F) vec1- as.vector(dat2) label1=c(0-25,25-50,50-75) Name1-unlist(lapply(0:123,function(i) rep(i+1,i))) dat3-data.frame(Name1,vec1) res-t(aggregate(.~Name1,data=dat3,function(x)

Re: [R] histogram

2013-03-04 Thread arun
Hi, If you meant to get the array index from `res1`, then this will do it.  But, if it is from 'dat3`, it will  be huge as each index is unique. indx-which(apply(res1,1,function(x) x!=0) ,arr.ind=TRUE)  Names2-do.call(rbind,lapply(1:3,function(i) {x-indx[indx[,2]==i,];

Re: [R] histogram

2013-02-17 Thread arun
HI Elisa, You could use ?cut() vec1-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45) label1-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x)

[R] Histogram plot spacing

2013-01-15 Thread Julie Collet
Dear all, I'd like to remove the space between the x-axis and the 0 of the y-axis in the hist function. I saw the previous post https://stat.ethz.ch/pipermail/r-help/2012-September/324177.html suggesting adding the x-axis at position 0 (or the lowest value of y) after making the histogram.

Re: [R] Histogram plot spacing

2013-01-15 Thread Uwe Ligges
On 15.01.2013 12:35, Julie Collet wrote: Dear all, I'd like to remove the space between the x-axis and the 0 of the y-axis in the hist function. I saw the previous post https://stat.ethz.ch/pipermail/r-help/2012-September/324177.html suggesting adding the x-axis at position 0 (or the

Re: [R] Histogram plot help

2012-12-04 Thread YAddo
Thanks, Rui and David! -- View this message in context: http://r.789695.n4.nabble.com/Histogram-plot-help-tp4651958p4652065.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Histogram plot help

2012-12-03 Thread YAddo
Dear All: I plotted a histogram with Abline, clipping with color codes but i run into some problems. The abline' does not show up at all, and when i request the 'prob=True' (to obtain the freqs), my clipped region colors the section of the graph instead of the plot only. Is there any way i

Re: [R] Histogram plot help

2012-12-03 Thread Rui Barradas
Hello, I can't say I understand your graph but as for the abline not showing up, it's outside the clipped region so it shouldn't. If you want it to show up, in the previous line, and after the hist() call, include clip(2, -2, usr[3], usr[4]) As for the decimals, those are normal, have you

Re: [R] Histogram plot help

2012-12-03 Thread David L Carlson
Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of YAddo Sent: Monday, December 03, 2012 4:22 PM To: r-help@r-project.org Subject: [R] Histogram plot help Dear All: I plotted a histogram with Abline, clipping with color codes but i run

Re: [R] histogram help

2012-11-22 Thread Jim Lemon
On 11/22/2012 05:15 AM, Rosario Scandurra wrote: Hi, I want to generate an histogram and plot on the y axis the percentage of a categorical variable and on the x axis a nominal variable. I want to move the origin to have 2 categories below 0. Hope somebody could help me. Thanks. Hi Rosario,

[R] histogram help

2012-11-21 Thread Rosario Scandurra
Hi, I want to generate an histogram and plot on the y axis the percentage of a categorical variable and on the x axis a nominal variable. I want to move the origin to have 2 categories below 0. Hope somebody could help me. Thanks. Best, -- Rosario Ivano Scandurra [[alternative HTML

Re: [R] histogram help

2012-11-21 Thread John Kane
Nov 2012 19:15:53 +0100 To: r-help@r-project.org Subject: [R] histogram help Hi, I want to generate an histogram and plot on the y axis the percentage of a categorical variable and on the x axis a nominal variable. I want to move the origin to have 2 categories below 0. Hope somebody could

[R] histogram corelation plots

2012-10-10 Thread sagarnikam123
i want to show histogram in innovative way (good if interactive) in html report..is threre any tutorials/hint also there is any package to show correalation plot -- View this message in context: http://r.789695.n4.nabble.com/histogram-corelation-plots-tp4645726.html Sent from the R help

Re: [R] histogram corelation plots

2012-10-10 Thread R. Michael Weylandt
On Wed, Oct 10, 2012 at 4:47 PM, sagarnikam123 sagarnikam...@gmail.com wrote: i want to show histogram in innovative way (good if interactive) in html report..is threre any tutorials/hint also there is any package to show correalation plot The histogram is well defined, so I'm not really sure

Re: [R] histogram corelation plots

2012-10-10 Thread David L Carlson
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of R. Michael Weylandt Sent: Wednesday, October 10, 2012 3:04 PM To: sagarnikam123 Cc: r-help@r-project.org Subject: Re: [R] histogram corelation plots On Wed, Oct 10, 2012 at 4:47 PM

[R] histogram plot spacing problem

2012-09-19 Thread firespot
Hi, So I plot a histogram using the built-in hist function: hist(rnorm(100), ...). Now the y-axis starts at its lower end at 0 (very sensible, of course) and that's where the baseline for the rectangles of the histogram is drawn, but the x-axis itself is offset a bit to the lower. I.e. there

Re: [R] histogram plot spacing problem

2012-09-19 Thread Rui Barradas
Hello, Try the following. x - rnorm(100) hist(x, xaxt = n) axis(1, at = pretty(x), pos = 0) Hope this helps, Rui Barradas Em 19-09-2012 18:51, firespot escreveu: Hi, So I plot a histogram using the built-in hist function: hist(rnorm(100), ...). Now the y-axis starts at its lower end at 0

Re: [R] Histogram to KDE

2012-09-06 Thread Tim Hesterberg
To bootstrap from a histogram, use sample(bins, replace = TRUE, prob = counts) Note that a kernel density estimate is biased, so some bootstrap confidence intervals have poor coverage properties. Furthermore, if the kernel bandwidth is data-driven then the estimate is not functional, so some

Re: [R] Histogram to KDE

2012-09-05 Thread firdaus.janoos
On Fri, Aug 31, 2012 at 12:15 PM, David L Carlson dcarl...@tamu.edu wrote: Using a data.frame x with columns bins and counts: x - structure(list(bins = c(3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5), counts = c(1, 1, 2, 3, 6, 18, 19, 23, 8, 10, 6, 2, 1)),

[R] Histogram to KDE

2012-08-31 Thread firdaus.janoos
Hello, I wanted to know if there was way to convert a histogram of a data-set to a kernel density estimate directly in R ? Specifically, I have a histogram [bins, counts] of samples {X1 ... XN} of a quantized variable X where there is one bin for each level of X, and I'ld like to directly get a

Re: [R] Histogram to KDE

2012-08-31 Thread David L Carlson
University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of firdaus.janoos Sent: Friday, August 31, 2012 9:52 AM To: r-help@r-project.org Subject: [R] Histogram to KDE Hello, I wanted to know

Re: [R] Histogram

2012-07-30 Thread Jim Silverton
I have the following codes: Now, suppose I have x = runif(1000,0,1, rep(1, 250), rep(0, 100) and I want to create a 'bin' for the 0's and the 1's and put the rest of the values in say about 20 bins. How can this be done? Jim On Thu, Jul 5, 2012 at 4:08 PM, Sarah Goslee sarah.gos...@gmail.com

Re: [R] Histogram

2012-07-30 Thread David Winsemius
On Jul 30, 2012, at 9:29 AM, Jim Silverton wrote: I have the following codes: Now, suppose I have x = runif(1000,0,1, rep(1, 250), rep(0, 100) and I want to create a 'bin' for the 0's and the 1's and put the rest of the values in say about 20 bins. How can this be done? ?cut -- David.

Re: [R] histogram of time-stamp data

2012-07-17 Thread e-letter
: Rui Barradas ruipbarra...@sapo.pt To: e-letter inp...@gmail.com Cc: r-help@r-project.org Subject: Re: [R] histogram of time-stamp data Message-ID: 5003e377.3000...@sapo.pt Content-Type: text/plain; charset=ISO-8859-1; format=flowed timestamps - as.POSIXct(Sys.Date

Re: [R] histogram of time-stamp data

2012-07-17 Thread Rui Barradas
: -- Message: 77 Date: Mon, 16 Jul 2012 10:48:39 +0100 From: Rui Barradas ruipbarra...@sapo.pt To: e-letter inp...@gmail.com Cc: r-help@r-project.org Subject: Re: [R] histogram of time-stamp data Message-ID: 5003e377.3000...@sapo.pt Content-Type: text/plain; charset=ISO-8859-1

Re: [R] histogram of time-stamp data

2012-07-17 Thread e-letter
On 17/07/2012, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, That's not the error I've had. You must be aware that read.table creates a data.frame and therefore the object 'timestamps' is NOT holding time stamps, it's holding a vector, 'V1', of time stamps. Was not aware of the

[R] histogram of time-stamp data

2012-07-16 Thread e-letter
Readers, A data set consists of time-stamp values: 00:00:00 23:11:00 06:22:00 The data set was imported: timestamps-read.table(path/to/timestampsvalues) hist(timestamps) ...error... x must be numeric Then tried: plot(timestamps). How to adjust the graph to create a histogram where the

Re: [R] histogram of time-stamp data

2012-07-16 Thread Jessica Streicher
pDates-as.POSIXct(times,format=%H:%M:%S) hist(pDates,hours) On 16.07.2012, at 10:47, e-letter wrote: Readers, A data set consists of time-stamp values: 00:00:00 23:11:00 06:22:00 The data set was imported: timestamps-read.table(path/to/timestampsvalues) hist(timestamps)

Re: [R] histogram of time-stamp data

2012-07-16 Thread Rui Barradas
Hello, Try the following. timestamps - as.POSIXct(Sys.Date()) + sample(24*60*60, 1e3, TRUE) h1 - cut(timestamps, breaks=hour) h2 - cut(timestamps, breaks=15 mins) op - par(mfrow=c(1, 2)) hist(as.integer(h1)) hist(as.integer(h2)) par(op) Hope this helps, Rui Barradas Em 16-07-2012 09:47,

Re: [R] histogram of time-stamp data

2012-07-16 Thread e-letter
On 16/07/2012, r-help-requ...@r-project.org r-help-requ...@r-project.org wrote: -- Message: 77 Date: Mon, 16 Jul 2012 10:48:39 +0100 From: Rui Barradas ruipbarra...@sapo.pt To: e-letter inp...@gmail.com Cc: r-help@r-project.org Subject: Re: [R

Re: [R] histogram of time-stamp data

2012-07-16 Thread Rui Barradas
...@gmail.com Cc: r-help@r-project.org Subject: Re: [R] histogram of time-stamp data Message-ID: 5003e377.3000...@sapo.pt Content-Type: text/plain; charset=ISO-8859-1; format=flowed timestamps - as.POSIXct(Sys.Date()) + sample(24*60*60, 1e3, TRUE) Why is it necessary to apply

Re: [R] Histogram

2012-07-05 Thread Jim Silverton
I have a column of 1000 datapoints from the normal distribution with mean 2 and variance 4. How can I get a histogram of these observations with 20 bins with each bin having 50 observations? -- Thanks, Jim. [[alternative HTML version deleted]]

Re: [R] Histogram

2012-07-05 Thread Sarah Goslee
Hi Jim, You can't specify both number of bins and bin size. You can specify breaks: either the number of bins or the location of breakpoints. A histogram with 20 bins of 50 observations each must by definition come from a uniform distribution. What are you trying to accomplish? Sarah On Thu,

Re: [R] Histogram

2012-07-05 Thread Rui Barradas
Hello, Try the following. x - rnorm(1000, mean=2, sd=2) p - seq(0, 1, by=1/20) quant - quantile(x, probs=p) hist(x, breaks=quant) The method is absolutely general, that's why I've separated the several steps, to make it clear. Hope this helps, Rui Barradas Em 05-07-2012 20:29, Jim

Re: [R] Histogram

2012-07-05 Thread Sarah Goslee
There's no reason you can't do that with normally-distributed data, though I'm not sure why you'd want to. My point was rather that you can't specify the bin width and size both. If you let the bin size vary, this will work: set.seed(1234) mydata - rnorm(1000, mean = 2, sd = 4) mydata.hist -

Re: [R] Histogram

2012-07-05 Thread Duncan Murdoch
On 05/07/2012 3:34 PM, Sarah Goslee wrote: Hi Jim, You can't specify both number of bins and bin size. You can specify breaks: either the number of bins or the location of breakpoints. A histogram with 20 bins of 50 observations each must by definition come from a uniform distribution. Only

Re: [R] Histogram

2012-07-05 Thread Rui Barradas
Hello, With the confusion between bin size and width the OP started, I'll repost my answer with a final line. Sorry for the repetition. h - hist(x, breaks=quantile(x, probs=seq(0, 1, by=1/20))) h$counts [1] 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 Hope this helps, Rui

Re: [R] Histogram

2012-07-05 Thread Sarah Goslee
Which gives Jim two ways to arrive at exactly the same result, just different means of specifying the probs for quantile(). Sarah On Thu, Jul 5, 2012 at 4:01 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, With the confusion between bin size and width the OP started, I'll repost my

Re: [R] histogram fill lattice

2012-06-15 Thread Deepayan Sarkar
On Wed, Jun 13, 2012 at 8:10 PM, David Winsemius dwinsem...@comcast.net wrote: On Jun 13, 2012, at 9:55 AM, Powell, Jeff wrote: Dear all, I would like to change the fill pattern of a histogram using histogram() in the lattice package.  I know how to do so using hist(), but would prefer to

Re: [R] histogram fill lattice

2012-06-15 Thread Powell, Jeff
-Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: woensdag 13 juni 2012 16:40 To: Powell, Jeff Cc: R-help@r-project.org Subject: Re: [R] histogram fill lattice On Jun 13, 2012, at 9:55 AM, Powell, Jeff wrote: Dear all, I would like to change the fill

Re: [R] histogram fill lattice

2012-06-15 Thread David Winsemius
includes col, so perhaps I'm out of luck? Why didn't you say so ... here ya' go. ?grid.pattern -- David With regards, Jeff -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: woensdag 13 juni 2012 16:40 To: Powell, Jeff Cc: R-help@r-project.org Subject: Re: [R

[R] histogram fill lattice

2012-06-13 Thread Powell, Jeff
Dear all, I would like to change the fill pattern of a histogram using histogram() in the lattice package. I know how to do so using hist(), but would prefer to stay within lattice. dt1 - rnorm(100,0,1) hist(dt1, density=3, angle=45) library(lattice) histogram(dt1, xlab =

Re: [R] histogram fill lattice

2012-06-13 Thread David Winsemius
On Jun 13, 2012, at 9:55 AM, Powell, Jeff wrote: Dear all, I would like to change the fill pattern of a histogram using histogram() in the lattice package. I know how to do so using hist(), but would prefer to stay within lattice. dt1 - rnorm(100,0,1) hist(dt1, density=3, angle=45)

Re: [R] Histogram classwise

2012-04-05 Thread Greg Snow
You might want to look at the lattice or ggplot2 packages, both of which can create a graph for each of the classes. On Tue, Apr 3, 2012 at 6:20 AM, arunkumar akpbond...@gmail.com wrote: Hi I have a data class wise. I want to create a histogram class wise without using for loop as it takes

[R] Histogram classwise

2012-04-03 Thread arunkumar1111
Hi I have a data class wise. I want to create a histogram class wise without using for loop as it takes a long time my data looks like this x class 27 1 93 3 65 5 1 2 69 5 2 1 92 4 49 5 55 4 46 1 51 3 100 4 - Thanks in

Re: [R] Histogram classwise

2012-04-03 Thread Sarah Goslee
I'm not entirely sure what you mean, but maybe split() and lapply() would help? Sarah On Tue, Apr 3, 2012 at 8:20 AM, arunkumar akpbond...@gmail.com wrote: Hi I have a data class wise. I want to create a histogram class wise without using for loop as it takes a long time my data looks

[R] Histogram from a table in R

2012-04-03 Thread gina_alessa
Hi all, I am new in R. I am trying to make an histogram but I can't figure it out. I have .cvs table with a lot of data that look like this: I already have the frequency of each interval (Counts). Interval Counts 00:19 0 10:19 3117 20:29 4500 30:39

  1   2   3   4   >