similar to: Creating multiple graphs based on one variable

Displaying 20 results from an estimated 5000 matches similar to: "Creating multiple graphs based on one variable"

2009 May 27
2
Object-oriented programming in R
Dear R-users, I have very recently started learning about object-oriented programming in R. I am far from being an expert in programming, although I do have an elementary C++ background. Please take a look at these lines of code. > some.data = data.frame(V1 = 1:5, V2 = 6:10) ; > p.plot = ggplot(data=some.data,aes(x=V1, y=V2)) ; > class(p.plot) ; > [1] "ggplot" My
2009 Apr 14
2
matrix merge problem
Dear r-help contributors, I have two questions: first: I have a matrix A and a vector B. I want to make a new matrix C, which is made of the rows of A having a value included in B. Second: I have two matrixes A and B, of different dimensions. B has unique values in column 2 and A has not unique values on column 2. I want to merge this two matrixes by the values in the columns 2 of B and 2 of
2009 Apr 07
2
Frequency table to histogram
I have read a frequency table in to R called "temp." I now want to create a histogram table from it, but I obviously first have to expand the data - to the sample size of 100. I want to use the command rep(), but I'm not sure how to go about it..I tried using the code: temp1<-rep(temp$Chest,100) hist(temp1) But this creates a v. odd histogram so I know it must be wrong!
2009 Dec 17
2
Sweave Makefile issue
Dear R-specialists, I am trying to create a Makefile that will first convert all my .Rnw files into .tex files and then, that will run the LaTeX compiler to produce a pdf document. This issue has been discussed before. Hence, I've basically adapted a Makefile I found at http://n4.nabble.com/R-Sweave-R-and-complex-latex-projects-td810020.html#a810023 to make it compatible with a Windows
2010 May 20
1
Kate terminal window
Dear R-users, I've recently switched to Ubuntu and I've decided to use Kate to edit my R code. I really like how Kate allows one to simply pipe their code to the terminal. However, I would find it even better if I could actually get the Kate console to display error messages (or any console outputs in fact) in red and my input in a different color. The instance of xterm that Ubuntu
2009 May 26
2
Problem with fractional seconds
Dear List, I am having problems converting a file with fractional seconds to class POSIXct. I have set my options to include digits.secs and my format to just time, but my output is the current date with my time lacking the fractions of a second. For example: options(digits.secs=3) t<-c("06:00:00.100","06:00:01.231") myt<-as.POSIXct(t,format="%H:%M:%S")
2009 Oct 09
4
Satellite ocean color palette?
Dear List, Is there a color palette avaliable similar to what is used in satellite ocean color imagery? I.e. a gradient with blue on one end and red on the other, with yellow in the middle? I have tried topo.colors(n) but that comes out more yellow on the end. I am looking for something similar to what is found on the CoastWatch web page:
2009 May 22
5
Need a faster function to replace missing data
Dear List, I need some help in coming up with a function that will take two data sets, determine if a value is missing in one, find a value in the second that was taken at about the same time, and substitute the second value in for where the first should have been. My problem is from a fish tracking study. We put acoustic tags in fish and track them for several days. Location data is supposed
2009 Sep 28
2
Data formatting for matplot
Dear List, I am wanting to produce a multiple line plot, and know I can do it with matplot but can't get my data in the format I need. I have a dataframe with three columns; individuals ID, x, and y. I have tried split() but it gives me a list of matrices, which is closer but not quite what I need. For example: id<-rep(seq(1,5,1),length.out=100) x<-rnorm(100,5,1)
2009 Aug 13
3
Finding minimum of time subset
Dear List, I have a data frame of data taken every few seconds. I would like to subset the data to retain only the data taken on the quarter hour, and as close to the quarter hour as possible. So far I have figured out how to subset the data to the quarter hour, but not how to keep only the minimum time for each quarter hour. For example:
2010 May 03
2
Estimating theta for negative binomial model
Dear List, I am trying to do model averaging for a negative binomial model using the package AICcmodavg. I need to use glm() since the package does not accept glm.nb() models. I can get glm() to work if I first run glm.nb and take theta from that model, but is there a simpler way to estimate theta for the glm model? The two models are: mod.nb<-glm.nb(mantas~site,data=mydata)
2011 Dec 06
1
Can't load package 'lars'
Hi, I installed package 'lars' earlier tonight and did not get any sort of error message. ### ** building package indices ... ** testing if installed package can be loaded Loaded lars 0.9-8 * DONE (lars) ### However, when I try to load it, I get ### > library(lars, lib.loc = "~/R/x86_64-redhat-linux-gnu-library/2.11") Error : .onLoad failed in loadNamespace() for
2009 Jul 24
3
Duplicated date values aren't duplicates
Dear list, I just had a function (as.ltraj in Adehabitat) give me the following error: "Error in as.ltraj(xy, id, date = da) : non unique dates for a given burst" I checked my dates and got the following: > dupes<-mydata$DateTime[duplicated(mydata$DateTime)] > dupes [1] (07/30/02 00:00:00) (08/06/03 17:45:00) Is there a reason different dates would come up as duplicate
2009 Dec 11
1
ggplot: Problem with legend background
Dear R-users, I am preparing graphs for an upcoming article using the different functions of the ggplot2 package and I've been having problems with the legend background. It doesn't seem to scale when the text size is increased. Here's the mandatory reproducible example: library(ggplot2) repFrame <- data.frame(A= 1:10, B= rnorm(1:10), groupNum = rep(c("First group",
2010 Feb 19
1
r help date format changes with c() vs. rbind()
Dear List, I am having a problem with dates and I would like to understand what is going on. Below is an example. I can produce a date/time using as.POSIXct, but I am trying to combine two as.POSIXct objects and keep getting strange results. I thought I was using the wrong origin, but according to structure(0,class="Date") I am not (see below). In my example a is a simple date/time
2009 May 08
2
Help to extract results from lme.object
Hi list, Would someone please give me a hint how to extract the between and within subject StdDev from "lme" fit? Below is the output from the fit, but I couldn't find the number 0.3927714 anywhere in the fitted object. Thanks in advance for your help! Random effects: Formula: ~1 | group (Intercept) Residual StdDev: 0.3927714 0.7857085 Best, Auston
2009 Sep 28
1
xyplot help - colors and break in plot
Dear List, I am new to lattice plots, and am having problems with getting my plot to do what I want. Specifically: 1. I would like the legend to have the same symbols as the plot. I tried simpleKey but can't seem to get it to work with autoKey. Right now my plot has dots (pch=19) and my legend shows circles. 2. I have nine groups but xyplot seems to only be using seven colors, so two
2010 May 19
8
Generating all possible models from full model
Is there a function that will allow me to run all model iterations if I specify a full model? I am using information criteria to choose between possible candidate models. I have been writing out all possible model combinations by hand, and I am always worried that I am missing models or have made a mistake somewhere. It is also difficult to alter models if I want to change a term. For example,
2005 Sep 15
2
Graphics 'snapshots' in Linux?
Hi, I'm working on a MEPIS (Debian-based Linux) computer, using the emacs/ESS package to do my R work. I've got some plots that I label interactively using the locate function. With the Windows GUI there is an option to take a snapshot of the graphics output, saving it as an image file. Is there a way to do this with emacs/ESS? Thanks, Tyler
2009 May 14
1
automated polynomial regression
Dear all - We perform some measurements with a machine that needs to be recalibrated. The best calibration we get with polynomial regression. The data might look like follows: > true_y <- c(1:50)*.8 > # the real values > m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2 > # the measured data > x <- c(1:50) > # and the x-axes > > # Now I do the following: