Re: [R] Delete/insert rows in data matrix

From: ronggui <ronggui.huang_at_gmail.com>
Date: Thu, 31 Jan 2008 21:21:46 +0800

How about this:

> DF<-data.frame(x=1:3,y=2:4)
> DF[4,]<-c(4,5)
> DF

  x y
1 1 2
2 2 3
3 3 4
4 4 5
> DF<-DF[,-4]
> DF

  x y
1 1 2
2 2 3
3 3 4
4 4 5

On 1/31/08, Eleni Christodoulou <elenichri_at_gmail.com> wrote:
> Hello all,
>
> I have the following problem. I want to insert blank rows in an data frame
> so as to make it comparable with another data frame with more rows. How can
> I insert these rows?
> If this is not solvable, then, alternatively, is it easy to delete rows from
> a data frame?
>
> Thanks for helping,
> Eleni
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
HUANG Ronggui

Bachelor of Social Work, Fudan University, China

Master of sociology, Fudan University, China

Ph.D. Student , CityU of HK,
http://www.cityu.edu.hk/sa/psa_web2006/students/rdegree/huangronggui.html

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 31 Jan 2008 - 13:32:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 Jan 2008 - 14:00:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive