[R] Lattice different colours for bars

2013-06-13 Thread Andrew McFadden (Andy)
Hi all Perhaps this is torturous methodology. I was trying to use lattice to produce a barchart showing the number positive and negative over time. I wasn't quite sure how create a different colour for values of arbo$Ikeda in the example below ie red for ikeda and green for neg.

[R] Lattice graph strips and axes

2011-11-22 Thread Andrew McFadden
= list(y = c(0.5),x = c(0.5)),scales = list(x = list(alternating = 1, tck = c(1,0)), y = list(alternating = 1, tck = c(1,0))), xlab = count (n), ylab = titer) useOuterStrips(x) Kind regards Andrew McFadden MVS BVSc | Veterinary Epidemiologist, Investigation and Diagnostic Centre | Biosecurity New

[R] Lattice graph help

2011-11-21 Thread Andrew McFadden
) Kind regards Andrew McFadden MVS BVSc | Veterinary Epidemiologist, Investigation and Diagnostic Centre | Biosecurity New Zealand Ministry of Agriculture and Forestry | 66 Ward St, Wallaceville | PO Box 40 742 | Upper Hutt | New Zealand Telephone: 64-4-894 5611 | Facsimile: 64-4-894 4973| Mobile

[R] Dealing with null values Aggregate function

2011-05-16 Thread Andrew McFadden
)) aggregate(x = testDF, by = list(testDF$v3), FUN = mean) For this example I would like to get a mean value for red (v1=4.5; v1=5) and blue (v1=49.5; v2=55) Thank you in advance. Andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New

[R] Overlapping x axes using Lattice

2011-05-03 Thread Andrew McFadden
, stack=TRUE,type = count, xlab=VNT,rot=c(180,180),draw=FALSE) Thank you in advance. Andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04 894 4973 Mobile 029 894

[R] Adding a regression line to an xyplot

2010-02-14 Thread Andrew McFadden
=a,ylab=b) I would appreciate your help. Kind regards andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04 894 4973 Mobile 029 894 5611 Postal address

Re: [R] [Requires Classification] Re: Adding a regression line to an xyplot

2010-02-14 Thread Andrew McFadden
Thanks, yes that does the trick, sorry inadvertently left the tavg in my example. I haven't used the panel function before looks like it maybe useful. Really appreciate your help. regards Andrew McFadden MVS BVSc | Incursion Investigator (animals), Investigation and Diagnostic Centre

[R] Subset function: selecting variables within a factor

2009-04-13 Thread Andrew McFadden
(80,90) I would appreciate your help. Kind regards andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04 894 4973 Mobile 029 894 5611 Postal address

Re: [R] [Requires Classification] Re: Subset function: selecting variables within a factor

2009-04-13 Thread Andrew McFadden
Hey Thomas Thanks mate I knew there had to be an easy answer. Thanks for coming to my rescue. Regards Andrew McFadden MVS BVSc | Incursion Investigator (animals), Investigation and Diagnostic Centre | Biosecurity New Zealand Ministry of Agriculture and Forestry | 66 Ward St, Wallaceville

[R] Recode of text variables

2009-04-01 Thread Andrew McFadden
of doing the same in R? Kind regards Andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04 894 4973 Mobile 029 894 5611 Postal address: Investigation

[R] Adjusting font size in a lattice graph

2009-03-31 Thread Andrew McFadden
Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04 894 4973 Mobile 029 894 5611 Postal address: Investigation and Diagnostic Centre- Wallaceville Box 40742 Ward St

[R] Combining columns from two dataframes

2009-03-17 Thread Andrew McFadden
),c(1:6)) names(a)=c(a,b) a b- data.frame(as.Date(c(2008-07-27,2008-10-01), format = %Y-%m-%d),c(1:2)) names(b)=c(c,d) a;b I have tried: append(a,b) combine(a,b) rbind(a,b) I would appreciate your help. Kind regards andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic

[R] R loop

2008-06-05 Thread Andrew McFadden
){ if (a$date[i]set a$date[i]set +7 ){a$wk-1}else if (a$date[i]set +7){a$wk-2}else {a$wk-3} } a Kind regards andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04

[R] Legend in scatterplot and adding regression lines

2008-05-12 Thread Andrew McFadden
(Dataset$Operator)), columns = 4)) Regards Andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04 894 4973 Mobile 029 894 5611 Postal address

[R] Finding unmatched data between two dataframe using several factors

2008-05-11 Thread Andrew McFadden
). I have tried two approaches but have not been successful ? nomatch - subset(dat1, is.element(?) == FALSE) ? setdiff(dat1$x,dat2$y) Any thoughts would be great Regards Andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand

[R] Spatial join between two datasets using x and y co-ordinates

2008-05-06 Thread Andrew McFadden
the same x and y co-ordinates as dataset 2. Any suggestions? Regards Andy Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04 894 4973 Mobile 029 894 5611 Postal

[R] Distances between two datasets of x and y co-ordinates

2008-03-12 Thread Andrew McFadden
Hi all I am trying to determine the distances between two datasets of x and y points. The number of points in dataset One is very small i.e. perhaps 5-10. The number of points in dataset Two is likely to be very large i.e. 20,000-30,000. My initial approach was to append the first dataset to

[R] R code for selecting places spatially and by time

2008-03-06 Thread Andrew McFadden
-01-02,2008-01-17,2008-01-01) ,format = %Y-%m-%d),c(4,4,2))) cbind(x,y,date) Regards Andrew Andrew McFadden MVS BVSc Incursion Investigator Investigation Diagnostic Centres - Wallaceville Biosecurity New Zealand Ministry of Agriculture and Forestry Phone 04 894 5600 Fax 04 894 4973 Mobile 029