Displaying 20 results from an estimated 2000 matches similar to: "Using the 'by' function within a 'for' loop"
2008 Apr 21
0
Using the 'by' function withing a 'for' loop
Dear R experts,
I am trying to optimize my script, because right
now it requires a lot of memory. The goal is to
generate four plots in one page. Every plot
corresponds to the means and sem's calculated for a
given variable at different days. In order to obtain
the means and sem's I apply the 'by' function. The way
I have done it so far is like this:
Read the data
Generate a
2013 May 18
3
bar plot with non-zero starting level
Hi,
I want to plot grouped bars to compare 95% confidence interval estimates
from two models. Each bar represents a 95% confidence interval estimate
of a coefficient from one of the two models. Each group represents
confidence interval estimates of the same coefficient from the two models.
I think such a bar plot will nicely present whether 95% confidence
interval estimates of the same
2010 Apr 04
4
ggplot2 geom_rect(): What am I missing here
Hi R fans,
As a newbie following the five-hour rule (after hitting my head against
the wall for five hours, post to this list), I am appealing for some
help understanding geom_rect() in ggplot2.
What I want to do is very simple. I want to generate a plot of
rectangles. Each one represents a business cycle. The x-values will be
pairs representing the start and end of each cycle. The y-values
2013 Mar 22
4
ggplot2 will not draw a rectangle. Error: ggplot2 doesn't know how to deal with data of class XXX"
What am I missing? When I run the code below I get the error message
"Error: ggplot2 doesn't know how to deal with data of class function"
Googling suggests a message of "Error: ggplot2 doesn't know how to deal with data of class XXX" is not uncommon but I don't see why I am getting a "function" error unless I am using some reserved word?
2002 Jan 25
2
selecting clusters of points
All:
Are there any functions out there for selecting all the
points in a region of a plot. I envision something like the
identify() function except one could circle a cloud of points (and
perhaps a vector would be returned of the same length as the points
plotted indicating logical membership in the circled cloud). Perhaps
someone has done something with the locator() function that would
2007 Jun 04
2
Abstract plot
I want to make a plot, but instead of showing _numerical_ values,
I would like to show _symbolic_ values.
For example, I want to plot a function y = a x + b, where
x varies between Xmin and Xmax. I would like the plot
to show, in the x-axis, the strings Xmin and Xmax, instead
of their numeric values. Is it possible?
Alberto Monteiro
2006 Jul 10
2
Setting the colors of lines in a trellis plot...
With some help from those with expertise on this list, I managed to
produce a plot using trellis that looked like I wanted it to look.
Now, I need to take the same plot and make the lines on it color, but
I want to specify the color for the lines myself.
I've managed to make the key use the colors I want. I've managed to
make the symbols of the actual plot use the colors I want. But I
2014 Jun 15
2
abline; setting plot limits
Relatively new user with a question regarding abline.
I want to draw a st. line fit to some data but I want the line to span the
range of the x-data and NOT the plot limits.
In short the line spans xmin to xmax(of plot axis) but I want it to span
xmin to xmax (of x data).
Can this but done with abline or do I have to use lines and construct the
line from a+bx?
Paul Rydelek, Ph.D.
5232 Dorset
2008 Jan 29
2
how do i creat multiple back to back histograms?
Een ingesloten tekst met niet-gespecificeerde tekenset is
van het bericht gescrubt ...
Naam: niet beschikbaar
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20080129/23f6cbc7/attachment.asc
2008 Jul 30
1
read XML
I have a xml exported by Manifold GIS but I'm not being able to import it
into R using XLM package.
The file have this structure:
<?xml version="1.0" encoding="UTF-8" ?>
- <layout>
<name>Layout 2</name>
<pagesByX>1</pagesByX>
<pagesByY>1</pagesByY>
- <elements>
<legend
2004 Sep 24
3
Error with repeat lines() in function
I have a function that does some plotting. I then add lines to the
plot. If executed one line at a time, there is not a problem. If I
execute the function, though, I get:
Error in ans[[1]] : subscript out of bounds
This always occurs after the second lines command, and doesn't happen
with all of my data points (some do not have errors). Any ideas?
Thanks,
Sean
2000 Dec 14
2
Accuracy problem in dchisq for non-central chi-squared
Hi,
I think I have identified a inaccuracy in dchisq when the non-centrality
parameter is non-zero and large. Here's a little test:
sys.dchisq.test <- function(N = 100000,mean = 0)
{
z <- rnorm(N,mean = mean, sd = 1)
x <- z^2
xmin <- min(x)
xmax <- max(x)
br <- seq(xmin,xmax,length = 101)
dbr <- br[2]-br[1]
hist(x,br)
p <- dchisq(br,df = 1,ncp =
2011 Oct 20
4
Randomized Points in space/ saving model results
A bit new to R and I'm working on something a bit more challenging than I am
used to- so here's whats going on:
Data inputs: 9 different shapefiles (.shp) of different point locations
(lat, long)
shapefile bounding box (lat/long corner points (14, 1)
(15,1) (14, 2) (15,2))
1 .csv of lat/long coordinates for points
Goal: a-
2009 Jul 11
2
maximum/minimum value of a function
Dear All,
Does anyone know how to get the maximum/minimum value of a function using R,
I think there should be an instruction, but i can not find it in help files
Thank you in advance for your help :)
[[alternative HTML version deleted]]
2010 Dec 02
4
2D Random walk
I've wrote some code to simulate a random walk in 2 dimensions on a lattice.
Basically I want to add something in to make it plot it point by point so
you can see what is going on.
Heres my code for the random walk in 2d
RW2D<-function(N)
{
i<-0
xdir<-0
ydir<-0
xpos<-vector()
xpos[1]<-xdir
ypos<-vector()
ypos[1]<-ydir
for (i in 1:N-1)
2012 May 19
3
converting csv to image file
Hello everyone,
I want to get a 1km by lkm grid raster image using my csv data. If I call
latitude=a, longitude=b and preciptation=c.
a<-(1,2,3,4,5)
b<-(6,7,8,9,10)
c<-(10,20, 30,40, 50)
Then I found an example in r help which goes like
pts = read.table("file.csv",......)
library(sp)
library(rgdal)
proj4string(pts)=CRS("+init=epsg:4326") # set it to lat-long
pts =
2006 Feb 21
1
color quantization / binning a variable into levels
Hi all,
I'd like to quantize a variable to map it into a limited set of integers
for use with a colormap. "image" and filled.contour" do this mapping
inside somewhere, but I'd like to choose the colors for plotting a set of
polygons. Is there a pre-existing function that does something like this
well? i.e., is capable of using 'breaks'?
2010 Jan 30
2
Using auto.key with two variable plots
Rhelpers:
Having a problem solving this. I have an xyplot call that looks
like this:
print(xyplot(temp_species_EAM_Pred_Pop$x+temp_species_NULL_Pred_Pop$x~temp_species_EAM_Pred_Pop$Action,main=current_species,
xlab="Action",ylab="Predicted Pop",
xlim=c(xmin,xmax),ylim=c(ymin,ymax),
2009 Apr 28
1
colored PCA biplot
Hi-
I'm trying to make my PCA (princomp) colored. In my csv excel sheet, I have
the first column numbered according to the groupings I want to assign to the
PCA. I've played around with trying to set this first column as the color
vector, but haven't had any luck.
Any suggestions? Thanks,
Hillary
[[alternative HTML version deleted]]
2011 Nov 15
2
break error bars in ggplot2
Hello,
i use ggplot to plot some measures including CIs as horizontal errorbars. I get an error when the scale limits are narrower than the boundaries of the error bar and hence the CIs are not plotted.
library(ggplot2)
df <- data.frame(resp=c(1,2), k=c(1,2), se=c(1,2))
ggplot(df, aes(resp,y=k)) + geom_point() + geom_errorbarh(aes(xmax = resp + se, xmin = resp - se)) +