November 2013 16:48
To: R help
Cc: Berend Hasselman; Benjamin Gillespie
Subject: Re: [R] Extract values from vector and repeat by group
Hi,
?merge() sometimes change the order.
For example:
df1 <- df[-12,]
df2 <- df1
merge(df1, df1[df1$time == 4, c("group", "var")], by.x
Hi all,
I hope you can help.
I have a data frame 'df':
group=c(rep(1,8),rep(2,10),rep(3,11))
var=rnorm(29)
time=c(seq(1,8),seq(1,10),seq(1,11))
df=data.frame(group,var,time)
I would like to extract the value from 'var' for each 'group' at 'time'=4 and
repeat these extracted values in a new vec
868 7641
o---o
http://www.geog.leeds.ac.uk/
o-o
@RiversBenG
o--o
From: PIKAL Petr [petr.pi...@precheza.cz]
Sent: 11 October 2013 14:06
To: Benjamin Gillespie; r-help@R-project.org
e(dt,id)
Would you be able to suggest any workarounds for a situation like this?
Many thanks in advance,
Ben Gillespie, Research Postgraduate
o---o
School of Geography, University of Leeds, Leeds, LS2 9JT
o------
Hi all,
I hope you can help with this one!
I have a dataframe: 'df' that consists of a vector of times: 'dt2' and a vector
of group id's: 'group':
dates2=rep("01/02/13",times=8)
times2=c("12:00:00","12:30:00","12:45:00","13:15:00","13:30:00","14:00:00","14:45:00","17:30:00")
y =paste(dates2, ti
: Benjamin Gillespie
Cc: R help
Subject: Re: [R] Possible loop/ if statement query
Hi,
Try:
b1<- b
b1[!b1>=7]<- NA
lst1 <- split(b1,cumsum(c(0,abs(diff(b>=7)
indx <- as.logical(((seq_along(lst1)-1)%%2))
lst1[indx]<- lapply(seq_along(lst1[indx]),function(i) {lst1[indx]
Dear r genii,
I hope you can help.
I have vector 'b':
b=c((1:10),sort(1:9,decreasing=TRUE),(2:12),sort(6:11,decreasing=TRUE),(7:13))
and, from 'b' I wish to create vector 'c':
c=c(
NA,NA,NA,NA,NA,NA,1,1,1,1,1,1,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,2,2,2,2,2,2,2,2,2,2,2,NA,3,3,3,3,3,3,3)
The
LS2 9JT
o---o
http://www.geog.leeds.ac.uk/
o-o
@RiversBenG
o--o
____
From: Benjamin Gillespie
Sent: 18 April 2013 15:38
To: r-help@R-project.org
Subject: Statistical test for heteroscedastic
Hi there,
Does anyone know of a statistical test for heteroscedasticity for an object of
class "gls"? (or alternative objective methods).
Thanks in advance,
Ben Gillespie, Research Postgraduate
o---o
School of Geography, University
Thanks to Dennis, Thomas and Rui - I was missing the "~".
Many thanks,
Ben Gillespie
Research Postgraduate
From: Dennis Murphy [djmu...@gmail.com]
Sent: 18 March 2013 20:47
To: Benjamin Gillespie
Subject: Re: [R] Superscript followed by n
Hi all,
I'm having problems finding the correct format for a command.
I would like to write some text on a plot.
I'm using the following command:
text(x,y,"text here", srt=90)
I would like the text to read:
capacity 10^3 m^3
(with ^ denoting superscript (i.e. each '3' as superscript).
I've
zopou...@erasmusmc.nl]
Sent: 04 February 2013 09:35
To: Benjamin Gillespie
Cc: r-help@r-project.org
Subject: Re: [R] Script for conditional sums of vectors
try this:
a <- c(1,1,1,1,1,1,2,2,2,2,2,2)
b <- c(1,1,1,2,3,4,1,1,2,2,3,4)
c <- c(400,200,300,100,500,300,200,100,500,400,200,100)
DF <
Hi guys,
I hope you can help me with this (probably) simple query:
I have a data frame:
--
a=c(1,1,1,1,1,1,2,2,2,2,2,2)
b=c(1,1,1,2,3,4,1,1,2,2,3,4)
c=c(400,200,300,100,500,300,200,100,500,400,200,100)
data=data.frame(a=a,b=b,c=c)
--
And I wou
ac.uk/
From: William Dunlap [wdun...@tibco.com]
Sent: 15 January 2013 16:51
To: Benjamin Gillespie; r-help@r-project.org
Subject: RE: Code to fetch summary info from vector
I don't completely understand the question, but if you are looking
for the lengths of the runs
Hi all,
Thanks in advance for any help.
I have a vector "b":
b=c(1,1,1,2,3,4,3,2,1,1,1,1,1,2,3,4,5,4,3.5,3,2,1,1,1)
Imagine b is river flow throughout time.
I would like some code that will generate the following information:
number of individual 'periods' where b>1 (= 2 in this case)
period
ember 2012 17:04
To: Benjamin Gillespie
Cc: R help
Subject: Re: [R] Script to count unique values from two linked matricies
Hi Ben,
No problem.
The code could be collapsed to 2 steps:
library(data.table)
library(reshape)
datm<-merge(melt(dat1),melt(dat2),by="Species")
dat3<-dat
14:22
To: Benjamin Gillespie
Cc: PIKAL Petr; Rui Barradas; Heramb Gadgil; R help
Subject: Re: [R] Script to count unique values from two linked matricies
Hi Ben,
Just a modification of Petr's solution with library(data.table):
dat1<-data.frame(Species=paste0("Species",1:3),Site1
ol of Geography
University of Leeds
Leeds
LS2 9JT
Tel: +44(0)113 34 33345
Mob: +44(0)770 868 7641
http://www.geog.leeds.ac.uk/
From: Heramb Gadgil [heramb.gad...@gmail.com]
Sent: 25 September 2012 10:38
To: Benjamin Gillespie
Cc: arun; r-help@r-project.org
you need any further
information,
Ben Gillespie
Research Postgraduate
School of Geography
University of Leeds
Leeds
LS2 9JT
Tel: +44(0)113 34 33345
Mob: +44(0)770 868 7641
http://www.geog.leeds.ac.uk/
From: arun [smartpink...@yahoo.com]
Sent: 24 Septem
15:35
To: Benjamin Gillespie; arun
Cc: R help
Subject: Re: [R] List creation based on matrix
If you don't have paste0() then you should upgrade to the current version of R.
---
Jeff Newmiller
uate
School of Geography
University of Leeds
Leeds
LS2 9JT
Tel: +44(0)113 34 33345
Mob: +44(0)770 868 7641
http://www.geog.leeds.ac.uk/
From: arun [smartpink...@yahoo.com]
Sent: 24 September 2012 14:01
To: Benjamin Gillespie
Cc: PIKAL Petr; R help
Subject: Re
[petr.pi...@precheza.cz]
Sent: 24 September 2012 13:39
To: Benjamin Gillespie; r-help@r-project.org
Subject: RE: [R] List creation based on matrix
Hi
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of benrgillespie
>
: PIKAL Petr [petr.pi...@precheza.cz]
Sent: 24 September 2012 13:34
To: Benjamin Gillespie; r-help@r-project.org
Subject: RE: [R] Script to count unique values from two linked matricies
Hi
I have no access to Nabble so it is difficult to understand what do you want.
> -Original Mess
23 matches
Mail list logo