On 12/18/2013 04:33 AM, bibek sharma wrote:
Hello R user,
I have created two plots (attached!) using the codes below
and would like to merge these figures in one. any suggestions are highly
appreciated!
Thanks,
plot(graph1$yod,graph1$xod,data=graph1)
dfx = data.frame(ev1=graph1$xod, ev2=graph1$
Here is a simple example (without the proportional size
bubbles--you've been given some references on that) using the lattice
package:
# one dataframe holds the data from both "sources" I call them.
# they would be data from your two separate dataframes,
# that you call graph1 and graph2
dd <- dat
On Tue, Dec 17, 2013 at 1:04 PM, bibek sharma wrote:
> Hi Sarah,
> It is not about mfrow or mfcol. I would like to see both sets of data in
> one figure.
> All I want was combining these two plots to one.
> Any suggestions?
> Bibek
Suggestions? Yes. Read the link I and others provided about
rep
What do you mean by "merge these figures in one"? If you want two
figures on one page, see ?par - specifically mfrow and mfcol.
If you want both sets of data in one figure, maybe ?points or ?lines
though I see you're already familiar with at least ?lines.
The list doesn't take most attachments, a
What do you mean by "merge" them into one? Make both graphs appear on
the same page of a document? Make a single figure containing both
graphs? Plot data from both dataframes on the same set of axes?
--Chris Ryan
On Tue, Dec 17, 2013 at 12:33 PM, bibek sharma wrote:
> Hello R user,
>
> I have
The plots did not arrive. The R-help list is fussy about what it allows to go
through.
Actually the best way of doing things is to use dput() to provide sample data.
See https://github.com/hadley/devtools/wiki/Reproducibility or
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r
: arun
Cc:
Sent: Friday, December 14, 2012 12:56 PM
Subject: Re: [R] Hello R User
Hi Arun,
Great!
Once we get, time1, I again wanna add time to its previous value for
example, wanna get 0,3 4 etc...
can I have suggestion?
On Fri, Dec 14, 2012 at 9:42 AM, arun wrote:
> Hi,
>
> You could
Hi,
You could also use library(data.table) to do this faster.
dat1<-read.table(text="
ID Time
1 3
1 6
1 7
1 10
1 16
2 12
2 18
2 19
2 25
2 28
2 30
",sep="",header=TRUE)
library(data.table)
dat2<-data.table(dat1)
res<-dat2[,Time1:=c(0,diff(Time)),by=ID]
head(res,
Hi Bibek,
how about this?
dta<-read.table(textConnection("ID Time
1 3
1 6
1 7
1 10
1 16
2 12
2 18
2 19
2 25
2 28
2 30"),header=T)
dta$delta<-with(dta,ave(Time,ID,FUN=function(x)c(0,diff(x
dta
hth.
Am 14.12.2012 16:51, sc
dataset<-data.frame(id=c(1,1,2,3,3,3),time=c(3,5,1,2,4,6))
dataset
id time
1 13
2 15
3 21
4 32
5 34
6 36
ids<-unique(dataset$id)
for(id in ids){
+ dataset$time[dataset$id==id]<-c(0,diff(dataset$time[dataset$id==id]))
+ }
dataset
id time
1 10
2 1
HI,
Try this:
dat1<-read.table(text="
ID Time
1 3
1 6
1 7
1 10
1 16
2 12
2 18
2 19
2 25
2 28
2 30
",sep="",header=TRUE)
dat1$Time1<-ave(dat1$Time,dat1$ID,FUN=function(x) c(0,diff(x)))
head(dat1,3)
# ID Time Time1
#1 1 3 0
#2 1 6 3
#3 1 7
11 matches
Mail list logo