search for: jamesdare26

Displaying 20 results from an estimated 26 matches for "jamesdare26".

2009 Jan 07
2
Plotting a graph for every Level of a Factor
Hello, I'm sorry if this seems similar to my last post but I thought it was significantly different to warrent a new thread. Using the dataset below, is there a way to generate a bar/line plot for the TACC/Catch of every lvl of stock? i.e. OR1,OR3,OR5. The picture at the bottom of this post is an example of the bar/line plot for OR1 which was generated when OR1 was the only stock in the
2009 Jan 15
1
Zoo Plot Can't Get Rid of Box
Hi, I apologise for the stupid question but how to you get rid of the box around a plot in the package zoo? I can't seem to find an equivalent for bty="l" i.e. just x and y axis. Cheers James -- View this message in context: http://www.nabble.com/Zoo-Plot-Can%27t-Get-Rid-of-Box-tp21468452p21468452.html Sent from the R help mailing list archive at Nabble.com.
2009 Apr 14
1
Lattice xyplot: Line and Rectangle in legend.
Hello fellow R users, I have a problem. I have created a barchart overlayed by an xyplot line, both of which read off the same Y axis. The problem comes when I try to generate a key. It seems that I can only create either two lines, or two rectangles. I would much prefer to have the barchat series depicted by a rectangle, and the xyplot series by a line. Is there a way to do this? Your help
2009 Jan 14
1
Help with Plot/Legend
Dear R-Users I have 2 questions: Firstly, If I create a matplot and legend for multiple vectors and then tag another vector on using matlines (e.g. a 'total' of all vectors), is there anyway to add the new line to the legend without recreating it? I have created the plot this way because I would like to define the lty and lwd for the 'total' vector so that it can be
2009 Oct 05
2
Loop function/comparison operator problem
Hi There, I have created the following function format<- function(){ repeat { form<-readline(paste("\nIn what format do you want to save these plots?\nChoose from: wmf, emf, png, jpg, jpeg, bmp, tif, tiff, ps, eps, or pdf.\nNote: eps is the suggested format for publication quality plots.\nPlot format --> ")); cat("\nI'm sorry, I don't know what that format
2009 Jul 27
2
Split rownames into factors
Hi Guys, I was wondering how you would go about solving the following problem: I have a list where the grouping information is in the row names. Rowname [,1] X1Jan08 324 X1Jun08 65 X1Dec08 543 X2Jan08 23 X2Jun08 54 X2Dec08 8765 X3Jan08 213 X3Jun08 43 X3Dec08 65 How can I create the following dataframe: Value Date Group [1,] 324 Jan 08 X1 [2,] 65 Jun 08
2009 Oct 01
2
Re gression for levels of a factor/xyplot type="r"
Hi, I'm sure these are basic problems so I apologise in advance for my ignorance. I have a dataset with X, Y, and a Factor with 4 levels. I am trying to figure out how to use lm() to find the r2 value, slope and intercept of an X~Y regression, for each level of the Factor. Is there a way to do this automatically without having to specify different subsets of the factor? my code so far:
2009 Mar 22
5
If statement generates two outputs
Hi, How do I tell an if statement to generate two seperate outputs. E.g If X>5 I want to create df1 and df2: if (X>5) {df1<-c(4,5,6,7,8) AND df2<-c(9,10,11,12,13)} Thanks, James -- View this message in context: http://www.nabble.com/If-statement-generates-two-outputs-tp22650844p22650844.html Sent from the R help mailing list archive at Nabble.com.
2009 Oct 12
1
Binding objects with a similar name
Dear R users, The code below splits a dataset by "target_species" and then further splits each target species group by year. Finally the sum of a variable called "total_hook_num" is calculated and then assigned a name based on (paste(a$target_species[1],a$year[1],sep=""). newsplit<-split(newdataset,list(newdataset$target_species)) for(i in newsplit){
2009 Mar 10
5
2 Simple Lattice Plot Questions
Hi, I have created the plot below and have a few questions about changes. 1) How do I change the "Year" title of each plot so it reads from the top "2006","2007","2008","2009". 2) How do I get rid of those vertical grey bars in the title bar of each plot? I apologise for my ignorance... one of those days :( James
2009 Mar 03
0
Two Column-group names using Latex(Hmisc)
Hi, Using the following code I can generate the attachment "Original.pdf": latex(test, file="C:/Documents and Settings/darej/My Documents/James/READY.tex", title = "", rowname = NULL, cgroup = c("Fishstock", stocknames), n.cgroup = c(1, rep(2,nostocks)), colheads = c("Year", rep(c("Catch",
2008 Dec 15
1
Population Decay in R
Hi, I am new to R. I am trying to plot the decay of a population over time (0-50yrs). I have the initial population value (5000) and the mortality rate (0.26/yr) and I can't figure out how to apply this so I get a remaining population value each year. In excel (ignoring headings) I would put 5000 in A1, in B2 I would enter the formula A1*0.26, and then in A2 (the next years population) I
2009 Jan 09
0
Graph Script/X-axis label Problem
Hi, I created the script below to plot multiple graphs. It seems to work pretty well (see BYX7) except when the max value for catch or TACC is very small. In this case the x-axis labels are removed from the x-axis (see BYX10). I can't figure out why given that y co-ordinate for the text function is par("usr")[1] - 0. Shouldn't this mean that it is flush to the x-axis? Can
2009 Mar 29
1
Two variables on one lattice barchart
Hi, I created the barchart below using the lattice package, however I can't seem to find a way to add another variable as a line (see the desired square/lines that I drew for the last 10 years of the plot). Can anyone help me with this? Your help is much appreciated! Code: Schart<-barchart(Catch~Year,data=SNA, scales=list(col = "black", tck = c(1, 0),x=list(rot=45)))
2009 Apr 07
1
Interesting Plot
Hello R Users, I was at a meeting earlier today, where the figure below was presented. Does anyone know what this type of plot is called? Is there an R package designed to generate these? Regards, James http://www.nabble.com/file/p22922671/Plot.gif Plot.gif -- View this message in context: http://www.nabble.com/Interesting-Plot-tp22922671p22922671.html Sent from the R help mailing list
2009 Apr 15
1
savePlot error when type = "eps" or "wmf"
Hello, When I use savePlot(filename="xy",type="eps") or savePlot(filename="xy",type="wmf") , I get the following error: Error in grid.Call("L_textBounds", as.graphicsAnnot(x$label), x$x, x$y, : Polygon edge not found (zero-width or zero-height?) This doesn't occur when I change the type to "jpeg" or "bmp". Can
2009 Jan 21
1
Text Outside Lattice Plot
Dear R users I created the graph at the bottom using xyplot in the lattice package. I added a title using the main="Title" command in xyplot, however it is plotted too close to the legend for my liking. To remedy this I increased the upper margin of the plot using plot(data, position = c(0,0,1,.9)) and attempted to move "SNA" upwards and to the right. I have tried using a
2009 Jan 22
1
Defining Solid Line using Line Type Specification
Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) where as the 9 groups just need to be distinguishable from each other. As you can probably see, when the group reaches CRA6 the lty starts from 1 again. I have tried to specify ten unique lines using lty=
2009 Oct 11
1
Function Help
Hi there, I have created the function below: pirate<-function(x){ a<-x-1; b<-a/5; c<-a-b; d<-c-1; e<-d/5; f<-d-e; g<-f-1; h<-g/5; i<-g-h; j<-i-1; k<-j/5; l<-j-k; m<-l-1; n<-m/5; o<-m-n; final<-o/5; final } I want to run this function until the output ('final') is an exact integer (e.g. 893.00000 rather than 893.78332). I then need to
2009 Feb 11
1
Table Formatting
Dear R-Users I have created the following table in R: Year TACC.SNA1 Catch.SNA1 TACC.SNA2 Catch.SNA2 TACC.SNA3 Catch.SNA3 111 1985-86 9396 18595 1860 530 1486 16727 112 1986-87 3155 12195 9506 7067 4991 2300 113 1987-88 6913 2074 3740