Re: [R] filtering number of values in a data frame

2009-06-18 Thread Simon Pickett
I think you can then use merge() to merge them back together n<- merge(n, df, by.x = c("m.values"), by.y = c("Start"), all.x = F, all.y = F) also see ?aggregate for a more efficient solution. HTH, Si. - Original Message - From: "Schönemann, Rene" To: Sent: Thursday, June 18, 2009

[R] win.metafile() and family

2009-06-18 Thread Simon Pickett
) : Font family not found in Windows font database dev.off() windows 2 Trawled through messages on here and read Rdegva but couldnt find the answer. Are there any user friendly windows user guides about all this? R 2.8.1 Windows XP 2003 Cheers, Si. Dr. Simon Pickett Research Ecologist

Re: [R] newbie help: simple operations in R

2009-06-02 Thread Simon Pickett
x so everything shifts down a row and add an NA on the end of Y > so that X and Y are the same length. look up the concatentae function ?c to > understand this. > > Data frame is not a problem. In that case its... > > x<-c(NA,quattro$x) > y<-c(quattro$y,NA) > quattro$t&

Re: [R] newbie help: simple operations in R

2009-06-02 Thread Simon Pickett
you want the table to go.csv",sep="") HTH, Si. ----- Original Message - From: Carletto Rossi To: Simon Pickett ; r-help@r-project.org Sent: Tuesday, June 02, 2009 12:03 PM Subject: Re: [R] newbie help: simple operations in R I' ve tried your suggestions but th

Re: [R] newbie help: simple operations in R

2009-06-02 Thread Simon Pickett
you could use a loop but maybe easier would be x<-c(NA,x) y<-c(y,NA) t<-x*y use write.table() to write the table to your hard drive e.g. write.table(t, file="C:/Documents and Settings/simonp/My Documents/RELU/GIS data/Land Cover Map working/squares plus adjoining parcels/Scotland/scotland adj

[R] data manipulation involving aggregate

2009-05-29 Thread Simon Pickett
his? My solution involves lots of intermediate aggregated data frames, one for each habitat, then a series of merges onto a bigger data frame. Thanks peeps and have a good weekend, Simon. Dr. Simon Pickett Research Ecologist Land Use Department Terrestrial Unit British Trust for Orni

Re: [R] Help me...!!!

2009-05-26 Thread Simon Pickett
have a read at these pdfs http://cran.r-project.org/other-docs.html you are likely to get a bashing for asking people to do your homework for you! Simon. - Original Message - From: "abel1682" To: Sent: Tuesday, May 26, 2009 3:37 PM Subject: [R] Help me...!!! Hi to all...i'm

Re: [R] Superscripts and subscripts in trellis graphics

2009-05-18 Thread Simon Pickett
Hi Steve, you need to use the expression() function. I think it is described under ?plotmath. Defo works with mtext, not sure about ylab. try ylab(text=c(expression(paste("Hatched Eggs R"^{2} etc. - Original Message - From: To: Sent: Monday, May 18, 2009 3:25 PM Subject: [R]

Re: [R] Simple plotting errors

2009-05-18 Thread Simon Pickett
read ?par 1.use ylab="" to suppress y labels, then mxtext to manually draw em yourself OR use mgp=... within par() 2.use xlab not xlim to change the x axis labels HTH, Si. - Original Message - From: "Steve Murray" To: ; ; ; Sent: Monday, May 18, 2009 1:39 PM Subject: RE: [R] Sim

Re: [R] Simple plotting errors

2009-05-18 Thread Simon Pickett
you mean you want to plot "SUM" against month? (assuming these12 data frames are 12 months). you could first bind them all together using data.frame(), see ?data.frame which would make it much easier. you need to create a variable for months then plot it against your variable. If you dont wa

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Simon Pickett
Sorry, I saw the word concatenate and dived in. Andrew Dolmans solution works fine. Simon. - Original Message - From: "Linlin Yan" To: "Simon Pickett" Cc: "Henning Wildhagen" ; Sent: Monday, May 18, 2009 12:30 PM Subject: Re: [R] Concatenating tw

Re: [R] Simple plotting errors

2009-05-18 Thread Simon Pickett
you mean you want to plot "SUM" against month? (assuming these12 data frames are 12 months). you could first bind them all together using data.frame(), see ?data.frame which would make it much easier. you need to create a variable for months then plot it against your variable. If you dont wa

Re: [R] Simple plotting errors

2009-05-18 Thread Simon Pickett
you mean you want to plot "SUM" against month? (assuming these12 data frames are 12 months). you could first bind them all together using data.frame(), see ?data.frame which would make it much easier. you need to create a variable for months then plot it against your variable. If you dont wa

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Simon Pickett
z<-c(x,y) cheers, Simon. - Original Message - From: "Henning Wildhagen" To: Sent: Monday, May 18, 2009 12:09 PM Subject: [R] Concatenating two vectors into one Dear users, a very simple question: Given two vectors x and y x<-as.character(c("A","B","C","D","E","F")) y<-as.facto

Re: [R] displaying results

2009-05-15 Thread Simon Pickett
Absolutely no idea what you mean, Try reconstructing your question in concise English with reproducible code. Simon. - Original Message - From: "deanj2k" To: Sent: Friday, May 15, 2009 1:33 PM Subject: [R] displaying results Hi everyone, can anyone tell me how i can change how

Re: [R] need help

2009-05-15 Thread Simon Pickett
Read about glm by typing ?glm There are tons of books and pdfs out there to show you the basics. http://cran.r-project.org/other-docs.html HTH, Si. - Original Message - From: "H Z" To: Sent: Friday, May 15, 2009 12:26 PM Subject: [R] need help Dear all please ,I need to write

Re: [R] read multiple large files into one dataframe

2009-05-13 Thread Simon Pickett
can you provide reproducible code please? even a fake example would help. I would 1) set up a loop to read in each file from a directory 2) inside the loop chop up/ aggregate the data, each file in turn and spit each new aggreagated file out to a directory using write.table(). This will redu

Re: [R] name siz ein cluster

2009-05-13 Thread Simon Pickett
I'm afraid I have no experience with the clue package, but if all else fails you could consider the hclust package. You change font size in the conventional way with this. Cheers, Simon. - Original Message - From: "Penner, Johannes" To: Sent: Wednesday, May 13, 2009 3:08 PM Subjec

Re: [R] I'm offering $300 for someone who know R-programming to do the assignments for me.

2009-05-08 Thread Simon Pickett
I bet at least a few people offered their services! It might be an undercover sting operation to weed out the unethical amongst us :-) - Original Message - From: "Wacek Kusnierczyk" To: "Tung86" Cc: "R help" Sent: Friday, May 08, 2009 3:18 PM Subject: Re: [R] I'm offering $300 for

Re: [R] I'm offering $300 for someone who know R-programming to dothe assignments for me.

2009-05-08 Thread Simon Pickett
at least he/she is resourceful! (but also very naughty) - Original Message - From: To: Cc: ; Sent: Friday, May 08, 2009 12:48 PM Subject: Re: [R] I'm offering $300 for someone who know R-programming to dothe assignments for me. Shame on you! Steve Friedman Ph. D. Spatial Stat

Re: [R] Do you use R for data manipulation?

2009-05-06 Thread Simon Pickett
Thanks Laura, I deal with huge data sets and have to do alot of fancy juggling of data to get the job done in R. I have recently been granted access to a cluster at a university which means 64 bit machines with 8gb of memory, which could prove to be a saviour hopefully. Simon. - O

Re: [R] Do you use R for data manipulation?

2009-05-06 Thread Simon Pickett
My institute uses SAS religiously, I am the only R "heathen". I have resisted learning to use SAS because I dont see the point after years of using R and I like being able to do everything using one program. However, my colleagues maintain that SAS is "better" for programming without really ev

Re: [R] joined R-today

2009-04-21 Thread Simon Pickett
Hi, Check out the FAQ on the home page about installing packages. You need to 1. Install the package from a local mirror, you can do this from the drop down menu ("Install packages") 2. then call the package using "library(name of the package)" It helps to know where your R library directory

Re: [R] R graph into MS Word: which format to use?

2009-04-20 Thread Simon Pickett
I actually get superior results from creating a pdf, opening it in adobe acrobat, adjust the image size so it is big as possible with the screen, then copying it into word (by using the little square capture icon). HTH, Simon. - Original Message - From: "jjh21" To: Sent: Monday, A

[R] reading an image and adding a legend

2009-04-09 Thread Simon Pickett
I feel I'm missing something obvious! Thanks Dr. Simon Pickett Research Ecologist Land Use Department Terrestrial Unit British Trust for Ornithology The Nunnery Thetford Norfolk IP242PU 01842750050 [[alternative HTML version deleted]] __ R-h

Re: [R] Manual sort in a for loop

2009-03-26 Thread Simon Pickett
I would suggest avoiding the function ?assign inside a loop. I used top use this until someone here kindly pointed out that it was much easier to catch the data of interest in a list... eg. df.list <- vector("list", length(10)) for (i in 1:10)} df.list[[i]]<-data.frame(arunoff_,table_year,_tem

Re: [R] Merging

2009-03-17 Thread Simon Pickett
Hi, I'm pretty sure you dont mean "merge" since merge() creates a new big data frame from two small ones. It appears that you want to omit some rows. As I said before, get used to selecting rows like this data.frame<-data.frame[data.frame$conditional.rows>1000,] (for example) Although I don

Re: [R] who can give me some hint?

2009-03-12 Thread Simon Pickett
Hi All, act_2 DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51

Re: [R] Mixed models fixed effects

2009-03-11 Thread Simon Pickett
Also check out these pdfs http://cran.r-project.org/other-docs.html and try to get your hands on the bible http://www.amazon.co.uk/R-Book-Michael-J-Crawley/dp/0470510242 Simon. Hi Emma, Continuous predictors are no problem at all. You can mix both continuous and categorial predictors if n

Re: [R] help structuring mixed model using lmer()

2009-03-10 Thread Simon Pickett
possible do to that using a glm approach. I think I have to run separate models for each site, calculate the gradient, then do a lm with gradient explained by habitat score Thanks, Simon. On Tue, Mar 10, 2009 at 10:15 AM, Simon Pickett wrote: This is partly a statistical question as

[R] help structuring mixed model using lmer()

2009-03-10 Thread Simon Pickett
ite), family=quasibinomial,data=m) anova(model1,model2) , but how do I test the interaction? Thanks in advance, Simon. Dr. Simon Pickett Research Ecologist Land Use Department Terrestrial Unit British Trust for Ornithology The Nunnery Thetford Norfolk IP242PU 01842750050 [[altern

Re: [R] Inference for R Spam

2009-02-24 Thread Simon Pickett
I got the same spam message today and I havent signed up for anything except this forum mailing list. The software they are trying to sell doesnt seem to cover any new ground anyway. Simon. - Original Message - From: "Thomas Lumley" To: "ronggui" Cc: Sent: Tuesday, February 24,

Re: [R] plotting questions

2009-02-20 Thread Simon Pickett
Hi Oliver, 1) thats easy, if you want to display several graphs at once type windows(), once for each new graph. 2) Not sure exactly what you mean here but you have complete control over graphs in R. e.g. plot a blank graph then add axex using axis(), add points using points(), etc. etc. C

Re: [R] write.table

2009-02-20 Thread Simon Pickett
Hi Laura, You need to specify where you want to write your table. Like this... write.table(result, file="C:/Documents and Settings/simonp/Desktop/result.csv", sep = ",",row.names = F) If you have to do this alot I think you can set your working drive up to always write table in the same plac

Re: [R] type III effect from glm()

2009-02-19 Thread Simon Pickett
00 Simon. - Original Message - From: To: "Simon Pickett" Sent: Thursday, February 19, 2009 10:50 AM Subject: RE: [R] type III effect from glm() Hi Simon: John Fox can say a lot more about below but I've been reading his book over and over recently and o

Re: [R] type III effect from glm()

2009-02-19 Thread Simon Pickett
Sorry, that was a typo in the email, not the model. So I still have the problem. Cheers, Simon. - Original Message - From: "Ted Harding" To: "Simon Pickett" ; Sent: Thursday, February 19, 2009 10:56 AM Subject: RE: [R] type III effect from glm() O

[R] type III effect from glm()

2009-02-19 Thread Simon Pickett
gnificance of a main effect when it is not in an interaction? Thanks in advance, Simon. Dr. Simon Pickett Research Ecologist Land Use Department Terrestrial Unit British Trust for Ornithology The Nunnery Thetford Norfolk IP242PU 01842750050 [[alter

Re: [R] Unadulterated plot

2009-02-16 Thread Simon Pickett
Hi James, What you really need to do is to check out the many freely available pdfs for R beginners. Here is a good place to start http://cran.r-project.org/other-docs.html If I am right interpreting what you want, I think you need to create a blank plot with no axes, axis labels etc. Try

Re: [R] How to split a character vector into 3 vectors

2009-02-11 Thread Simon Pickett
someone has probably answered this already but use substr() new variable<-substr(old.variable,1,1) Simon. - Original Message - From: "kayj" To: Sent: Tuesday, February 10, 2009 6:50 PM Subject: [R] How to split a character vector into 3 vectors Hi , Does any one know how to spl

[R] data editor in R- could it be improved?

2009-02-04 Thread Simon Pickett
e the names might often be very big if the data frame was created using a function). Side-ways scrolling is quite "jerky" too. Just wondered if this was on anyone else's wish list? Simon. Dr. Simon Pickett Research Ecologist Land Use Department Terrestrial Unit British Trust for Orn

[R] help using zeroinfl()

2009-01-22 Thread Simon Pickett
library") y<-c(0,0.2,0.4,0.7,0,0,0,0.8,0,0,0,0,0) x<-c(3,4,5,2,3,6,3,7,4,8,5,8,3) m1<-zeroinfl(y~x|x) Zero-Inflated Count Model Using logit to model zero vs non-zero Using Poisson for counts Error in terms.formula(formula, data = data) : argument is not a valid model Can anyone shed any light pleas

[R] creating a list of matrices or data frames

2009-01-20 Thread Simon Pickett
Hi all, How would you create a list of data.frames within a loop, then bind all the elements of the list using rbind? take this example of matrices with differing numbers of rows for(i in 1:3){ assign(paste("s",i, sep=""),matrix(data = NA, nrow = i, ncol = 3, byrow = FALSE, dimnames = NULL))

[R] faster version of split()?

2009-01-16 Thread Simon Pickett
Hi all, I want to calculate the number of unique observations of "y" in each level of "x" from my data frame "df". this does the job but it is very slow for this big data frame (159503 rows, 11 columns). group.list <- split(df$y,df$x) count <- function(x) length(unique(na.omit(x))) sapp

Re: [R] R in the NY Times

2009-01-07 Thread Simon Pickett
I would like to add that I would have spent many more years doing my PhD if it wasnt for R! all data management, statistics and graphics were conducted using it. This was the direction my university and many more research institutes appear to be heading. It probably doesnt get said enough and

Re: [R] Two Noobie questions

2009-01-07 Thread Simon Pickett
Allen, I would suggest reading about the str() function. It's great for getting "inside" model outputs and seeing how they are constructed so you can extract all the specific calculations you want. Its a bit fiddly to get used to but there are plenty of examples on this forum. Hope this he

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
Edwin Sendjaja" To: "Simon Pickett" Cc: Sent: Tuesday, January 06, 2009 5:04 PM Subject: Re: [R] Large Dataset Hi Simons, Is SAS more powerfull than R? Well, I think I cannot afford to buy SAS. actually, my computer isn't really slow. I think 4GB RAM is big enough fo

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
luck. Simon. - Original Message - From: "Edwin Sendjaja" To: "Simon Pickett" Cc: Sent: Tuesday, January 06, 2009 2:53 PM Subject: Re: [R] Large Dataset Hi Simon, My RAM is only 3.2 GB (actually it should be 4 GB, but my Motherboard doesnt support it. R use

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
Yup, it was a typo. But I always try capital if lower case doesnt work, Sorry. - Original Message - From: "David Winsemius" To: "Simon Pickett" Cc: "Edwin Sendjaja" ; Sent: Tuesday, January 06, 2009 12:40 PM Subject: Re: [R] Large Dataset When I

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
Only a couple of weeks ago I had to deal with this. adjust the memory limit as follows, although you might not want 4000, that is quite high memory.limit(size = 4000) Simon. - Original Message - From: "Edwin Sendjaja" To: "Simon Pickett" Cc: Sent: Tuesd

Re: [R] Large Dataset

2009-01-06 Thread Simon Pickett
type ?memory into R and that will explain what to do... S - Original Message - From: "Edwin Sendjaja" To: Sent: Tuesday, January 06, 2009 11:41 AM Subject: [R] Large Dataset Hi alI, I have a 3.1 GB Dataset ( with 11 coloumns and lots data in int and string). If I use read.ta

Re: [R] Changing Matrix Header

2009-01-06 Thread Simon Pickett
Hi Gundala, try chopping off the top row like newx<-as.matrix(x[2:dim(x)[1],]) OR try changing it to a data frame... new x<-data.frame(x,row.names=NULL) #pretty sure its not row.names but there is probably an equivalent for col.names OR look into ?read.table and specify header = F Cheers,

Re: [R] I need course in R

2008-12-19 Thread Simon Pickett
yes I did, sorry. obviously good for stats rather than general code but still good bed time reading :-) Simon. - Original Message - From: "June Kim" To: "Simon Pickett" Sent: Friday, December 19, 2008 3:28 PM Subject: Re: [R] I need course in R On Fri, Dec

Re: [R] re ad.table

2008-12-19 Thread Simon Pickett
probably best just to change each variable one by one to the correct classification after you have read the data frame in. variable<-as.character(variable) - Original Message - From: "threshold" To: Sent: Friday, December 19, 2008 12:35 PM Subject: [R] re ad.table Hi , I want t

Re: [R] Akaike weight in R

2008-12-19 Thread Simon Pickett
I'm pretty sure you have to work it out yourself. Here is an example of how you would tabulate the AIC weights from three models (check that my calculations are correct before using this yourself!). Basically model.name$aic will cut out the AIC values then write a formula to calculate the weig

Re: [R] I need course in R

2008-12-19 Thread Simon Pickett
It is a steep learning curve, but once you get to grips with the basics, I've found that I can find out everything else I need to know by searching these archives... Hope this helps, Simon Pickett. - Original Message - From: "Uwe Ligges" To: "xavier ordoñe

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Simon Pickett
Actually, Both these solutions create contingency tables, with frequency rather than the original count values. Is there a way to retain the original count values? Thanks again, Simon. - Original Message - From: "Simon Pickett" To: "Gabor Grothendieck" ; &

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Simon Pickett
Thanks Gregor and Henrique for the eloquent and masterful replies, These solutions have saved me hours (maybe even days) of work in the future, I am very grateful. :-) Simon. - Original Message - From: "Gabor Grothendieck" To: "Henrique Dallazuanna" Cc: &qu

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Simon Pickett
Wow, thats amazing, thanks very much!!! Simon. - Original Message - From: Henrique Dallazuanna To: Simon Pickett Cc: r-help@r-project.org Sent: Thursday, December 18, 2008 11:25 AM Subject: Re: [R] inserting zero instances with zeroes in a matrix Try this: with

[R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Simon Pickett
Hi all, Suppose I had the below example where a survey was carried out recording the number of each type of pet in each house count<-c(2,1,2,1,2,3,4) house<-c("house1","house1","house2","house3","house4","house4","house4") pet<-c("dogs","cats","dogs","dogs","budgie","cat","hamster") d.f<-data.fr

Re: [R] Extracting the name of an object into a character string and vice versa

2008-12-12 Thread Simon Pickett
paste() ?paste - Original Message - From: "Philip Whittall" To: Sent: Friday, December 12, 2008 1:30 PM Subject: Re: [R] Extracting the name of an object into a character string and vice versa I am still struggling to map a character string to an object name and vice versa in R

[R] help: programming loop, binding columns between data sets

2008-12-11 Thread Simon Pickett
lumns from "a" across to "b" all at once. In this case I often have to paste each column one at a time which takes forever. I often am dealing with very large data sets. I am using R 2.1.1 on Windows Vista. Can anyone suggest a faster/more reliable alternative alternative