similar to: overlay two histograms ggplot

Displaying 20 results from an estimated 2000 matches similar to: "overlay two histograms ggplot"

2017 Nov 07
1
fill histogram in ggplot
Hi all, I have the following data and I have a histogram for mms like ggplot(hist,aes(x=hist$mms))+ geom_histogram(binwidth=1,fill="white",color="black")and then I want to fill the color of histogram by probable=1 and probable=0, could anyone help me in this? My data: structure(list(probable = c(1L, 0L, 1L, 1L, 0L, 1L, 0L, 1L, 1L, 0L, 1L, 0L, 1L, 0L, 1L, 0L, 1L, 1L,
2010 May 10
1
ggplot: Trouble with xlim() and discrete scales
I'm learning ggplot and am a little confused. Sometimes discrete scales work like I'd expect, and sometimes they don't. For example... This works exactly like one would expect: df<-data.frame(names=c("Bob","Mary","Joe","Bob","Bob")) ggplot(df,aes(names))+geom_histogram() But this yields an error:
2023 Jan 12
1
Reg: ggplot error
Hallo I am not familiar with any of packages you use (except of MASS and ggplot2) and the code is too complicated without any hint where the error could come from and what is the message you get. I wonder if anybody would like to go through your whole code. 1. data seems to be read correctly ICUData <- read.csv(file = "ICUData.csv", stringsAsFactors = TRUE) ICUData.neuro <-
2005 Dec 06
2
Constructing a transition matrix
Hi, I would like to construct a transition matrix from a data frame with annual transitions of marked plants. plant<-c(1:6) class<-c("seed","seed", "seed", "veg", "rep", "rep") fate<-c("dead", "veg","veg","rep", "rep", "veg") trans<-data.frame(plant, class, fate)
2009 Apr 22
2
function output with for loop and if statement
Hello all, turns out i'm having a bad R week. I am at my wits end with a function that I am trying to write. When I run the lines of code outside of a function, I get the desired output. When I wrap the lines of code into a function it doesn't work as expected. Not sure what is going on here. I suspected that the syntax of the if statement with the for loop was the culprit, but when I
2008 Jun 13
1
overlaid transparent histograms
Hello all-- I'm attempting to produce overlaid histograms with partially transparent columns. Whether this display will end up being useful, I can't say. But I do want to get it right. I've already got one solution (shown below), but I tried some other versions and had questions about my results. (Note: I'm using a quartz device, so transparency shows up correctly. You might
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...)    
2017 Nov 01
1
Creating Tag
i want to tag categories to its menuname. i have a csv containing menu item name and in other csv i have a column containing some strings, i want to pick that strings from categories and look into menu items if any menu item containing that string i want to create a new column next to menu item name flagged as 1 otherwise 0 and the only condition is once a menu item flagged as 1 i don't need
2010 Nov 08
1
R help: reorder columns in an xyplot
Hello. First post, though I have read scores. Mostly i can solve my problems reading the archives, but I lack the vocabulary to ask this one right. Any social faux pais, I apologize. I am sure this is a very basic question and I am embarrassed to ask, but I spent several hours scouring the archives and trying various suggestions, but I am too new to get any of them to work. I am trying to
2008 Sep 10
2
DNS Logging with Selinux enabled
I rebuilt my server and setup bind to log queries in a chroot. ################################################################################ # Logging Configuration # logging { # # Define channels for the two log files # channel query_log { severity info; print-time yes; file "/var/log/query.log" versions 3 size 100M; }; channel activity_log
2009 Nov 04
1
Patterned shading in ggplot
Am trying to produce a graph which prints out well in black and white using ggplot2. I have the following example set up nicely, but want to shade the red bars in one pattern and the blue in another so they print out clearly. I tried changing colours to 1 light, 1 dark, but then the overlapping colour looks virtually identical to the darker one. I noted the option density in barplot, but
2012 Oct 04
4
Creating vegetation distance groups from one column
Hi R listers, I am trying to group distances of nests to the vegetation into classes that are define by (0-5m, 6-10m, 11-15m, 16-20m, 21-25m, 26-30m, 31-35m, 36-40m, 41-45m, 46-50m, 51-55m, 56-60m). Each row is a nest and all the distances to the vegetation is in a column. In plyr, I have tried - below script but I think I am going about this the wrong way and am not successful. #Veg index
2013 Jul 25
1
GGplot 2 – cannot get histogram and box plot axis to match.
Problem: I am trying to get the histogram and box plot x axis to match. I?ve tried using the expand_limits function to make the axis match but that didn?t make the axis match. The histogram?s axis are still consistently larger than the ones for the box plot (though the function did help). Does anyone have a suggestion as to what I should do instead? Background: I am building a Shiny app that
2010 May 26
1
Fill a matrix using logical arguments?
Hello all, I am going slightly mad trying to create a table for running co-correspondence analysis. What I have is seed bank and vegetation data, and my aim is to see if the vegetation found in a site (containing several seed bank samples) can predict the composition of a seed bank sample within that site. So for this I need two tables with matching rows. I have created an empty matrix,
2012 Jan 19
2
add1 GLM - Warning message, what does it mean?
Hi All, I am wondering if anyone can tell me what the warning message below the model means? J add1(DTA.glm,~ Aeventexhumed + Veg + Berm + HTL + Estuary + Rayos) Single term additions Model: cbind(MaxHatch, TotalEggs - MaxHatch) ~ Aeventexhumed + Veg + Berm + HTL Df Deviance AIC <none> 488.86 4232.9 Estuary 1 454.96 4201.0 Rayos 3 258.80 4008.9 Warning
2012 Oct 05
3
Anova
Hi R-listers, I am trying to do an ANOVA for the following scatterplot and received the following error: library(car) scatterplot(HSuccess ~ Veg, data = data.to.analyze, xlab = "Vegetation border (m)", ylab = "Hatching success (%)") anova(HSuccess ~ Veg, data=data.to.analyze) Error in UseMethod("anova") : no applicable
2008 Oct 30
1
nfs mounted /home and selinux
I'm trying to set the context on an nfs mounted /home. I believe exactly like in Redhat's Deployment Guide at http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deployment_Guide/ch45s02s03.html On my system running CentOS 5.2: $ ls -alZ /home drwxr-xr-x root root system_u:object_r:home_root_t . drwxr-xr-x root root system_u:object_r:root_t .. $ mount -t
2011 Feb 18
1
plot3d, color points by group
Hello I've created a 3d scatterplot, and had no problems labeling the points. However, I've been really struggling to change the color of the points based on a factor (see 'group' below). Is such a thing possible? My data look like this: food group x y z apple fruit 0.216 -0.112 -0.893 orange fruit 0.814 0.097 0.460 broccoli veg -0.239 0.240 -0.425 banana
2007 May 15
1
stacked barplot with positive and negatvie values
Hello I'm trying to create a barplot with a couple of stacked positive values and with one negative value for each group. example: trees<-c(20,30,10) shrubs<-c(12,23,9) veg<-c(2,3,4) soil<-c(-100,-123,-89) example1<-t(cbind(trees,shrubs,veg)) barplot(example1) #this works so far #but now: example2<-t(cbind(trees,shrubs,veg,soil)) barplot(example2) This shows no more
2010 Jul 29
2
ggplot2 histograms... a subtle error found
Hello all, I have a peculiar and particular bug that I stumbled across with ggplot2. I cannot seem to replicate it with anything other than my specific data set. Here is the problem: - when I try to plot a histogram, allowing for ggplot2 to decide the binwidths itself, I get the following error: - stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to