Hi
the other option to get last item is
tail(pheno.dt$year,1)
Regards
Petr
r-help-boun...@r-project.org napsal dne 23.09.2010 12:02:35:
> Yes, thanks! :)
>
> 2010-09-23 11:55, Ivan Calandra skrev:
> >Hi,
> > xlim and ylim should be given the extremes only:
> >
> > plot(x,y, xlim=c(pheno.d
Yes, thanks! :)
2010-09-23 11:55, Ivan Calandra skrev:
>Hi,
> xlim and ylim should be given the extremes only:
>
> plot(x,y, xlim=c(pheno.dt$year[1],pheno.dt$year[nrow(pheno.dt)]),
> ylim=c(50,150), xlab="Year", ylab="Julian Day")
>^^
Hi,
xlim and ylim should be given the extremes only:
plot(x,y, xlim=c(pheno.dt$year[1],pheno.dt$year[nrow(pheno.dt)]),
ylim=c(50,150), xlab="Year", ylab="Julian Day")
^^ ^^
Does it work now?
Ivan
Le 9/23/2010 11:44, fuge
On Sep 23, 2010, at 11:44 , fugelpitch wrote:
>
> Sorry, but now I understand what you're doing, and it works as a stand-alone
> in the console! :)
>
> But why doesn't it work in the xlim?
You have a colon where a comma would work.
BTW: Wouldn't xlim=range(pheno.dt$year) be more expedient?
>
OK, got it to work now, just messed up the ","' and ":". Thank you!
--
View this message in context:
http://r.789695.n4.nabble.com/referencing-last-row-in-a-column-tp2551645p2551721.html
Sent from the R help mailing list archive at Nabble.com.
__
R-he
Sorry, but now I understand what you're doing, and it works as a stand-alone
in the console! :)
But why doesn't it work in the xlim?
__
> pheno.dt$year[1]
[1] 1877
> pheno.dt$year[nrow(pheno.dt)]
[1] 1916
> plot(x,y, x
Thanks, but I have multiple entries for each year so the column reads:
year
1877
1877
1877
1877
1878
1878
1878
1878
1879
1879
1879
1879
So I need to pick out the year from the last row rather than just counting
rows.
--
View this message in context:
http://r.789695.n4.nabble.com/referencin
You could do data$year[ nrow(data) ]
On 23 September 2010 18:56, fugelpitch wrote:
>
> I am trying to set u a limit for my plot window according to the range of a
> year column I have.
> The first year in the range is just simply the first row, referred to as
> data$year[1]. How can I find the la
I am trying to set u a limit for my plot window according to the range of a
year column I have.
The first year in the range is just simply the first row, referred to as
data$year[1]. How can I find the last row in a similar way to set the last
year in the range?
What I want to accomplish is the f
9 matches
Mail list logo