Displaying 20 results from an estimated 2000 matches similar to: "A variation on the bar plot"
2008 Aug 31
1
how to draw a perspective pyramid
Dear list,
I am trying to construct a perspective plot of a 2D triangle, or pyramid. I
can easily do the one dimensional plot (code below), but I can't figure out
how to do it in a perspective plot for two input variables. Does anyone
have a simple solution?
Thanks!
Derek
#code for a triangle
u <- seq(-1,1,.001)
tri <- (1-abs(u))
plot(tri~u,type="l",main="Second
2007 Sep 10
5
finding the minimum positive value of some data
useRs,
I am looking to find the minimum positive value of some data I have.
Currently, I am able to find the minimum of data after I apply some other
functions to it:
> x
[1] 1 0 1 2 3 3 4 5 5 5 6 7 8 8 9 9 10 10
> sort(x)
[1] 0 1 1 2 3 3 4 5 5 5 6 7 8 8 9 9 10 10
> diff(sort(x))
[1] 1 0 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0
> min(diff(sort(x)))
[1] 0
2009 Jul 09
9
Population pyramids
Hi, I hope somebody can help me with this issue: I am doing population pyramids using the barplot command, so in the left side I have male age structure and in the right side the female age structure. To plot the male age structure I put the data in negative numbers. Now, I want to change the sign in the bar plot in such way that I have no-sign numbers, both in left and right side of the graph. I
2010 Feb 13
4
Labels on a pyramide
I am using pyramid.plot() from the plotrix package.
I have something like this
############################################
xy.pop<-dados$masfr
xx.pop<-dados$femfr
#agelabels<-dados$femlab
xycol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),11)
xxcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),11)
xylab<-dados$maslab
xxlab<-dados$femlab
2013 Feb 16
4
Creating a Double Bar Graph With Provided DataSet
To the volunteers of R-Help.
Hello, I am currently stuck on an RStudio assignment. The assignment
involves creating a double bar graph with the provided info
http://math.fullerton.edu/mori/data/introstats/pennstate3.txt
My professor has only gone over the very basics of RStudio and we only
learned how to make a simple bar graph and labeling x and y axis. The
specific directions from my
2008 Jul 29
3
finding a faster way to do an iterative computation
useR's,
I am trying trying to find out if there is a faster way to do a certain
computation. I have successfully used FOR loops and the apply function to
do this, but it can take some time to fully compute, but I was wondering if
anyone may know of a different function or way to do this:
> x
[1] 1 2 3 4 5
> xk
[1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
I want to do:
2012 Apr 12
2
pyramid.plot in plotrix, axis labelling
Hi, I've been looking at ways to make pyramid plots in R. I like the pyramid.plot method in plotrix as it seems the simplest to use and building them in ggplot looks a bit more code intensive than I'd like, being as I'm new to R. This package does pretty much what I need it to do, however I can't seem to scale the x axis labels. The other labels scale fine with labelcex.
I
2008 Jul 24
2
simple random number generation
useR's,
I want to randomly generate 500 numbers from the standard normal
distribution, i.e. N(0,1), but I only want them to be generated in the range
-1.5 to 1.5. Does anyone have a simple way to do this?
Thanks,
dxc13
--
View this message in context: http://www.nabble.com/simple-random-number-generation-tp18642611p18642611.html
Sent from the R help mailing list archive at Nabble.com.
2008 Jan 16
3
color ranges on a 2D plot
useR's
I am trying to color the points on a scatter plot (code below) with two
colors. Red for values 0.5 -1.0 and blue for 0.0 - .49. Does anyone know a
easy way to do this?
x <- runif(100, 0, 1)
y <- runif(100, 0, 1)
plot(y ~ x, pch=16)
Thanks,
dxc13
--
View this message in context: http://www.nabble.com/color-ranges-on-a-2D-plot-tp14893457p14893457.html
Sent from the R help
2009 May 24
2
Deleting columns from a matrix
useR's,
I have a matrix given by the code:
mat <-
matrix(c(rep(NA,10),1,2,3,4,5,6,7,8,9,10,10,9,8,NA,6,5,4,NA,2,1,rep(NA,10),1,2,3,4,NA,6,7,8,9,10),10,5)
This is a 10x5 matrix containing missing values. All columns except the
second contain missing values. I want to delete all columns that contain
ALL missing values, and in this case, it would be the first and fourth
columns. Any column
2009 May 19
3
how to calculate means of matrix elements
useR's,
I have several matrices of size 4x4 that I want to calculate means of their
respective positions with. For example, consider I have 3 matrices given by
the code:
mat1 <- matrix(sample(1:20,16,replace=T),4,4)
mat2 <- matrix(sample(-5:15,16,replace=T),4,4)
mat3 <- matrix(sample(5:25,16,replace=T),4,4)
The result I want is one matrix of size 4x4 in which position [1,1] is the
2007 Sep 17
2
how to compare 2 numeric vectors
useR's
I am trying to compare two vectors that have the same length. More
specifically, I am interested in comparing the corresponding positions of
each element in the vector.
Consider these two vectors of length 20:
v1 <- 2 2 4 NA NA NA 10 NA NA NA NA NA NA NA NA NA NA
NA NA NA
v2 <- NA 4 NA NA NA NA 10 NA NA NA NA NA NA NA NA NA NA
NA
2009 Apr 30
2
gridding values in a data frame
Hi all,
I have a data frame that looks like such:
LATITUDE LONGITUDE TEMPERATURE TIME
36.73 -176.43 58.32 1
50.95 90.00 74.39 1
-30.42 5.45 23.26 1
15.81 -109.31 52.44 1
-80.75 -144.95 66.19 2
90.00 100.55 37.50 2
2009 Jul 30
1
Transparency and pyramid.plot
Hi all
Another question related to my earlier -- how might I get transparency to work
with pyramid.plot in library(plotrix)? I can't figure it out, and the help page
says it is there but doesn't give an example.
Thanks!
2009 May 11
2
Plotting colors on a world map
Hi useR's
I have created a simple map of the world using the following code:
m <- map(xlim=c(-180,180), ylim=c(-90,90))
map.axes()
I then create a grid of dimension 36x72 using the code:
map.grid(m, nx=72, ny=36, labels=FALSE, col="black")
This gives 2592 grid cells. In a separate data set of dimension 36x72, I
have 2592 temperature values (some missing values are present)
2011 Nov 14
1
Confused with an error message related to "plotrix" library in the newer versions of R.
Dear R Users,
Greetings!
I am confused with an error message related to "plotrix" library in the
newer versions of R.
I used to run an R script without fail in the earlier versions (R 2.8.1) of
R; but the same script is now throwing up an error message in the newer
versions (Now I have R 2.13.0 & R 2.14.0).
Herewith I am furnishing the same code for your perusal. It would
2009 Dec 09
3
Population Histogram
How would I make a population histogram in R from an excel file? Thanks
[[alternative HTML version deleted]]
2008 Feb 21
3
applying a function to data frame columns
useR's,
I want to apply this function to the columns of a data frame:
u[u >= range(v)[1] & u <= range(v)[2]]
where u is the n column data frame under consideration and v is a data frame
of values with the same number of columns as u. For example,
v1 <- c(1,2,3)
v2 <- c(3,4,5)
v3 <- c(2,3,4)
v <- as.data.frame(cbind(v1,v2,v3))
uk1 <- seq(min(v1) - .5, max(v1) + .5,
2008 Aug 30
1
help with "persp" function
Dear List,
I am trying to draw a rectangular plane using the persp function, however I
can't seem to get it to work. I want the length along x1 axis to be between
1 and 3 and the length along the x2 axis to be between 1 and 4. All z
values for x1 should be equal (say, z=1) because this is a plane, not a
cube. Below is my current code. Any help is appreciated
Thanks in advance
dxc13
x
2009 May 13
4
plotting a grid with color on a map
Hi all,
I have posted similar questions regarding this topic, but I just can't seem
to get over the hump and find a straightforward way to do this. I have
attached my file as a reference.
Basically, the attached file is a 5 degree by 5 degree grid of the the world
(2592 cells), most of them are NA's. I just want to be able to plot this
grid over a world map and color code the cells. For