similar to: Changing the base of geom_bar in ggplot

Displaying 20 results from an estimated 10000 matches similar to: "Changing the base of geom_bar in ggplot"

2017 Aug 18
1
help with stacked ggplot
Hi, I am new to R and this is probably a very basic question but I can?t seem to figure out a solution. I am creating a stacked ggplot with the following data and code: PercentageData.csv looks like this: decision treatment percentage labtreatment defect 0 53.49 COMMON defect 1 78.00 ASYMMETRIC defect 2 96.67 PRIVATE coop 0 46.51 COMMON coop 1 22.00 ASYMMETRIC coop 2 3.33 PRIVATE %Load data:
2008 Aug 19
4
converting coordinates from utm to longitude / latitude
Hi, is there a function in R to convert data read with read.shape and which is originally in UTM coordinates into longitude / latitude coordinates? I found the convUL() function from the PBSmapping package but I have no idea how I could apply that to the read.shape object. Many thanks, Werner __________________________________________________ Do sragenden Schutz gegen Massenmails.
2006 Apr 05
5
List to Array
Hi, this is probably the easiest thing to do but I manage not finding the answer: I have a list with matrices of exact same format and headers. Now I would like to transform the list into an normal array. What is the proper way to do this? as.array changes the entire format and right now I only found the method of creating a new array, going through the entire list and copy the matrix in each
2011 Nov 16
1
geom_bar with missing data in package ggplot
Dear all, I was hoping someone could help with a ggplot question. I would like to generate a faceted bar chart, but missing data are causing problems. g<-structure(list(Date = structure(c(11322, 11687, 12052, 11322, 11687, 12052, 11322, 11687, 12052, 11322, 11687, 12052), class = "Date"), variable = c("Govt Revenues to GDP", "Govt Revenues to GDP",
2011 Mar 24
1
questions regarding stat_smooth in ggplot area plot
Hello, I drew a simple area plot using ggplot2 using set <- read.table(file="http://www.jovian.nl/set.csv", head=1, sep=",") library(ggplot2) ggplot() + layer( data = set, mapping = aes(x = time, y = hours), geom = "area", stat="smooth", color="red" ) + layer( data = set, mapping = aes(x = time, y = hours), geom = "area",
2013 Apr 30
1
Stacked geom_bar with aggregated SE -ggplot2
Hi there,? I've been battling with an extension of this in my own data: getting appropriate error bars once data is stacked in a bar graph.? (original question: http://r.789695.n4.nabble.com/ggplot2-se-variable-in-geom-errorbar-s-limits- td3311176.html). It wouldn't let me reply to that thread. A modification of the earlier answer:? data(diamonds)? ?diamonds_df <- ddply(diamonds,
2008 Jul 27
4
Object-oriented programming in R for Java programmers?
Hi, I was wondering if anybody might have a reference for me: My R code is growing and getting more and more confusing. Thus, I figure it's time to switch to object-oriented again. I have done oo programming in C++ and Java before but the first few tutorial on R oo were a bit confusing for me. Is there any brief tutorial on oo programming in R especially for people who have done oo in Java
2010 Sep 10
3
ggplot bar geom: control the filling in the colour legend
Hi all, Is it possible to change the filling of the squares used to represent the colour legend in a bar plot with ggplot? in this example, fillings are raven black, I'd like them white. ggplot(diamonds, aes(clarity, colour = cut)) + geom_bar() Regards -- ------------- Benoit Boulinguiez Ph.D student Ecole de Chimie de Rennes (ENSCR) Bureau 1.20 Equipe CIP UMR CNRS 6226 "Sciences
2006 May 12
3
optimal way to compute matrix subtotals?
Hi! I have large matrices, one column per variable and I have a vector of factors / grouping symbols. Then I am computing subtotals for the groups but it takes pretty long and thus I wanted to ask if there is a better way to do it or if this is already the best way: subTotals <- function(x, groupvec) do.call("rbind",lapply(split(x,groupvec),colSums,na.rm=T)) Thanks reading my
2008 Feb 21
2
column name handling and long labels
Hi, I have two loosely related questions which could make my live again a bit easier: 1) Is there a simple way to select a range of columns in a data frame using column names? I am thinking of something like mydf[1,"col4":"col8"] 2) I have a data frame with many columns and they all have short variable names which is good in most cases but sometimes it would be nice to have
2010 Jan 09
2
Functions for QUAIDS and nonlinear SUR?
Hi, I would like to estimate a quadratic almost ideal demand system in R which is estimated usually by nonlinear seemingly unrelated regression. But there is no such function in R yet but it is readily available in STATA (nlsur), see B. Poi (2008): Demand-system estimation: Update, Stata Journal 8(4). Now I am thinking, what is quicker learning to "program" STATA which seems not really
2008 Feb 26
2
Custom LaTeX tables
Hello, I am very happy that I have Sweave and R to write my papers. But I still have to do some tables by hand since I have not found out how I can customize the latex tables produced by R further (I mainly use xtable()). Like for instance, I have a table which needs an extra row every few rows as a group header and sometimes I want some extra horizontal lines in the table and also a multicolumn
2006 Jan 10
5
matching country name tables from different sources
Hi, Before I reinvent the wheel I wanted to kindly ask you for your opinion if there is a simple way to do it. I want to merge a larger number of tables from different data sources in R and the matching criterium are country names. The tables are of different size and sometimes the country names do differ slightly. Has anyone done this or any recommendation on what commands I
2010 Jan 19
4
Remove term from formula for predict.lm
Hi, probably just a quick question: can I somehow change the formula used with predict? E.g., the regression was run on "y ~ u + v + w" but for the prediction the term v should be removed from the formula contained in the regression object and only "y ~ u + w" be used. I could use model.matrix etc. to do the predictions but it would be very helpful to know a simpler way.
2009 Mar 02
4
portable R editor
Hi, I have been dreaming about a complete R environment on my USB stick for a long time. Now I finally want to realize it but what I am missing is a good, portable editor for R which has tabs and syntax highlighting, can execute code, has bookmarks and a little project file management facility pretty much like Tinn-R has those. I like Tinn-R but it seems like there is only a very old version of
2010 Jan 22
3
Once again: Error: cannot allocate vector of size
Hi, I have browsed the help list and looked at the FAQ but I don't find conclusive evidence if this is normal or I am doing something wrong. I am running a lm() on a data.frame with 27136 observations of 6 variables (3 num and 3 factor). After a while R throws this: > lm(log(y) ~ log(a) + log(b) + c + d + e, data=reg.data , na.action=na.exclude) Error: cannot allocate vector of size
2009 Sep 11
1
bar chart with means - using ggplot
Like this? # example using qplot library(ggplot2) meanprice <- tapply(diamonds$price, diamonds$cut, mean);meanprice cut <- factor(levels(diamonds$cut), levels = levels(diamonds$cut)) qplot(cut, meanprice, geom="bar", stat="identity", fill = I("grey50")) dev.new() # create a new graph to compare with qplot # Example using ggplot ggdata <-
2018 Jan 15
5
barplot that displays sums of values of 2 y colums grouped by different variables
I am trying to create a barplot displaying the sums of 2 columns of data grouped by a variable. the data is set up like this: "city" "n" "y" <br> mon 100 200 <br> tor 209 300 <br> edm 98 87 <br> mon 20 76 <br> tor 50 96 <br> edm 62 27 <br> the resulting plot should have city as the x-axis, 2 bars per city, 1 representing
2018 Jan 15
0
barplot that displays sums of values of 2 y colums grouped by different variables
It is not generally advisable to get too fancy with stat functions in ggplot... things can easily get more complicated than ggplot is ready to handle when it comes to calculations. It is better to create data that corresponds directly to the graphical representations you are mapping them to. Read [1] for more on this philosophy. [1] H. Wickham, Tidy Data, Journal of Statistical Software,
2009 Aug 06
1
solving system of equations involving non-linearities
Hi, I would appreciate if someone could help me on track with this problem. I want to compute some parameters from a system of equations given a number of sample observations. The system looks like this: sum_i( A+b_i>0 & A+b_i>C+d_i) = x sum_i( C+d_i>0 & C+d_i>A+b_i) = y sum_i( exp(E+f_i) * ( A+b_i>0 & A+b_i>C+d_i) = z A, C, E are free variables while the other