similar to: Trying to get values to display on horizontal barchart

Displaying 20 results from an estimated 8000 matches similar to: "Trying to get values to display on horizontal barchart"

2005 Aug 29
1
ylim for graphic
Dear list: I have some data for which I am generating a series of barplots for percentages. One issue that I am dealing with is that I am trying to get the legend to print in a fixed location for each chart generated by the data. Because these charts are being created in a loop, with different data, my code searches the data to identify the maximum value in the data and then print the data values
2005 Aug 24
2
Remove NAs from Barplot
Dear List: I'm creating a series of barplots using Sweave that must assume a standard format. This is student achievement data and the x-axis must include all grades 3 to 8. In some cases, the data for a grade (or more than one grade) are missing in the vector math.bar, but are never missing for the vector apmxpmeet. The following sample code illustrates the issue. Using the code below to
2010 Feb 28
3
Change the scale on a barplot's y axis
I have grades data. I read them from a csv in letter-grade format. I then converted them to levels levels(grades$grade)=c('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-') And then to numbers grades$gp=grades$grade levels(grades$gp)=c(4.3,4.0,3.7, 3.3,3.0,2.7, 2.3,2.0,1.7, 1.3,1.0,0.7)
2010 Oct 29
2
wilcox.test; data type conversion?
I'm working on a quick tutorial for my students, and was planning on using Mann-Whitney U as one of the tests. I have the following (fake) data grade <- c("MVG", "VG", "VG", "G", "MVG", "G", "VG", "G", "VG") sex <- c( "male", "male", "female", "male",
2010 Apr 09
2
error bars on barplot
Hi I was hoping someone might be able to help me I have this data: birdid timetaken numvisits ptachchoice time bold 1087 8 10 1 AM 0 1087 28 6 1 PM 0 1087 13 3 2 AM 0 1087 121 0 2 PM 0 1046 121 0 1 AM 1 1046 121 0
2004 Jun 06
4
Request help writing a function
I have been wrestling with this function for quite a while, and am not making headway. 1) I want to apply a function to the following columns of a dataframe: myfunction. <- apply(ph5028[,c(83:107)],2,function(x) ... 2) Within each of the above columns there is a single numeric code, 1, 2 or 3 or an NA. 3) My goal is to determine the percent of time each person used a 2 code. So if a person
2016 Oct 25
2
Colores en names.arg de un barplot()
Hola. Tengo un gráfico que tiene muchos names.arg (demasiados...), de modo tal que le vendría bien al lector usar colores intercalados, tal que el primero sea azul, el segundo negro, el tercero azul, cuarto negro, y así. Es decir, definir un vector "similar" a este: rep(c("black", "blue"), length(barras[,1]/2) que permita pintar uno y uno en este gráfico:
2009 Jul 25
1
yaxp problem for more irregular time series in one plot
Good day, I'm trying to get more time series in one plot. As there are bigger differences in values of variables I need logaritmic y axis. The code I use is the following: nvz_3_data <- read.csv('/home/tomas/R_outputs/nvz_3.csv') date <- (nvz_3_data$date) NO3 <- (nvz_3_data$NO3) NH4 <- (nvz_3_data$NH4) date_p <- as.POSIXct(date, "CET") par(mfrow=c(2,1), ylog
2010 Mar 23
3
barplot (stacked)
Dear all, I want to draw a barplot with the following data: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 110.0675 118.4167 117.16 109.735416 101.6312 104.0312 101.8263 99.38541670 114.2613 [2,] 0.0000 0.0000 0.00 1.658333 0.0000 0.6250 0.0000 0.05208333 0.0000 [,10] [,11] [,12] [,13] [,14] [,15] [,16]
2005 Aug 25
1
Attempting to recode elements contained in a list
Hello R-Masters, I have a list 's' with three elements, as shown below. I want to recode a.a, a.a2, and a.a3 to NA if the value in a.a is less than 3. I reivewed my Modern Applied Statistic Book, the online help and did some searching of R-help on the internet. I explored unlist and as.list.data.frame in an attempt to isolate the third element of the list s, but this was not helpful.
2004 Nov 28
1
Modifications to an abline
Dear List: I am working to generate graphs for individual students that will be created through a series of loops in Sweave. Before doing so, I am still trying to design the graph. The code for creating the barplot is below with some sample datapoints just made up for now. Ultimately, this chart will take data from an lme object using longitudinal student data. So, the dots represent the
2008 Oct 19
1
convert lines to inches
Hi, how can I convert the unit "lines" of par("mar") into inches? par("mai") could help, but does not (see code below). I want to plot a curve in a predefined size in pdf (I add some margin space to the plot width&height, everything is in cm): pdf("test.pdf",width=(20+2+4)/2.54,height=(10+3+1)/2.54) plot(10:30,
2016 Oct 25
2
Colores en names.arg de un barplot()
Gracias, Javier. Está muy bueno el post, pero en efecto refiere a legend y no a los names.arg Adjunto un archivo para poder correr el gráfico. Creo que eso ayuda a precisar el problema. Las etiquetas que aparecen al costado izquierdo de las barras son las que quiere pintar de negro y azul. También va a necesitar este objeto para que la sintaxis corra sin errores: library(RColorBrewer) #Para
2024 Mar 22
1
geom_edge & color
Hi, this seems to work (assuming that your problem was the setting of colours...): --- snip --- network %>% ggraph(., layout = "auto") + # This produces an error... # geom_edge_arc(curvature=0.3, aes(width=(E(network)$weight/10), color=c("darkblue", "red")[as.factor(edge_list$relationship)], alpha=0.5)) + # ... this works :-)
2024 Mar 20
1
geom_edge & color
Dear community I am using ggraph to plot a network analysis. See part 2 in the working example. Besides different colors for different groups of nodes: --> geom_node_point(aes(size = V(network)$hub_score*200, color= as.factor(V(network)$community))) I additionally want to consider different colors for different edge groups The grouping is defined in the edge_list$relationship: negative
2004 Apr 03
3
Seeking help for outomating regression (over columns) and storing selected output
Hello, I have spent considerable time trying to figure out that which I am about to describe. This included searching Help, consulting my various R books, and trail and (always) error. I have been assuming I would need to use a loop (looping over columns) but perhaps and apply function would do the trick. I have unsuccessfully tried both. A scaled down version of my situation is as follows:
2016 Sep 06
2
Gráfico de Barras
Hola. Siguiendo a Mittal (2001); R Graph Cookbook creo haber logrado construir el gráfico de barras que buscada. La matriz que utilizo para el "height" va adjunta. Y mi sintaxis: barplot(t(barras), col=col.segmentos, border=F , names.arg=Meses, las=2, cex=.75, cex.axis=0.8 , ylab="% del Segmento sobre el Total") legend(.5, .2, ncol=5, cex=.75,
2017 Dec 20
2
outlining (highlighting) pixels in ggplot2
Using the small reproducible example below, I'd like to know if one can somehow use the matrix "sig" (defined below) to add a black outline (with lwd=2) to all pixels with a corresponding value of 1 in the matrix 'sig'? So for example, in the ggplot2 plot below, the pixel located at [1,3] would be outlined by a black square since the value at sig[1,3] == 1. This is my first
2003 Oct 07
3
Problem getting an ifelse statment to work
This is a "long" way; i.e., not necessarily efficient: > qs2 [1] 2 1 1 4 4 4 1 1 1 4 2 4 3 1 4 3 3 2 4 3 > qs9 [1] 4 4 1 3 4 3 1 3 1 4 1 2 3 3 4 4 1 4 2 3 > decision <- function(a, b) { + if (a == 1 || b == 1) return(1) + if (a == 2 || b == 2) return(2) + if (a == 3 || b == 3) return(3) + if (a == 4 || b == 4) return(4) + NA + } > mapply(decision,
2007 Dec 09
1
Setting the grid of a graph of timeseries
I have the following code #################################################################### library(zoo) miedate <- yearmon((2006)+seq(0,23)/12) tab <- zoo(cbind(A = c(79.47, 89.13, 84.86, 75.68, 72.82, 78.87, 93.46, 78.18, 82.46, 77.25, 80.95, 84.39, 81.7, 74.76, 65.29, 60.3, 66.59, 73.19, 92.39, 65.76, 77.45, 74.22, 101.36, 100.01), B = c(77.95, 76.73, 51.2, 51.86, 51.29, 49.45,