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
) :
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
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&
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
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
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
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
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]
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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
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
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
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
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
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
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
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
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
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))
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
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
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
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
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
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
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
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
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,
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
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
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
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
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" ; &
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
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
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
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
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
61 matches
Mail list logo