[R] hi have a question about merging.
santosh.srinivas at gmail.com
Thu Dec 9 07:19:56 CET 2010
male.df <- subset(raceprofiling, (male==1))
female.df <- subset(raceprofiling, (male==0))
people.df <- rbind(male.df,female.df)
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of tanzia chaudhury
Sent: 09 December 2010 09:02
To: r-help at r-project.org
Subject: [R] hi have a question about merging.
this is the problem:
load this R data frame over the internet and save it to your hard drive.
please show how to save a dataset of males only (the variable male=1) to a
new dataframe. Then do the same thing for females (male=0). Then show how to
recombine the two datasets to belike the original one except that the female
rst, then the male observations. This resultingdataset should be the same
size as the original.
this is what i did so far:
# loading the R data frame over the internet
and saving it to your hard drive
#this shows that in the RData file there are
5000 obs. of 10 variables.
the fourth dataset, please show how to save a dataset of males only (the
#to a new #data frame.
#The same thing for females (male=0).
now to merge:
I tried >merge(newr,news)
but this does not give the same observation as the original file. I also
tried rbind, but this gives me error. Please help
[[alternative HTML version deleted]]
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help