kangam3
2012-Sep-15 09:22 UTC
[R] how to view only readings of a selected data from a column while the other columns remain
Hi Friends I am new here and have a problem Year Market Winner BID 1 1990 ABC Apple 0.1260 2 1990 ABC Apple 0.1395 3 1990 EFG Pear 0.1350 4 1991 EFG Apple 0.1113 5 1991 EFG Orange 0.1094 For each year and separately for the two markets (i.e.,ABC,EFG), examine the combined data for Apple and Pear on the bid price variable BID for presence of potential outliers.5 Identify instances where you observe the presence of potential outliers. I managed to separate the data by year only y <- c(1, seq(300))> year1991 <- subset(X, y < 39) > year1991Year1991 <- year1991[, c(1,2,3,5)]> Year1991now I need help on whats the right R command to key to select(View) only ABC of the Market COLUMN, which the other column values remains. Is it possible to do multiple separation at one time? or step by step Kindly advise :) -- View this message in context: http://r.789695.n4.nabble.com/how-to-view-only-readings-of-a-selected-data-from-a-column-while-the-other-columns-remain-tp4643216.html Sent from the R help mailing list archive at Nabble.com.
Rui Barradas
2012-Sep-15 10:51 UTC
[R] how to view only readings of a selected data from a column while the other columns remain
Homework. There's a no homework policy, but see ?aggregate. Rui Barradas Em 15-09-2012 10:22, kangam3 escreveu:> Hi Friends > > I am new here and have a problem > > Year Market Winner BID > 1 1990 ABC Apple 0.1260 > 2 1990 ABC Apple 0.1395 > 3 1990 EFG Pear 0.1350 > 4 1991 EFG Apple 0.1113 > 5 1991 EFG Orange 0.1094 > > > For each year and separately for the two markets (i.e.,ABC,EFG), examine the > combined data for Apple and Pear on the bid price variable BID for presence > of potential outliers.5 Identify instances where you observe the presence of > potential outliers. > > I managed to separate the data by year only > > y <- c(1, seq(300)) >> year1991 <- subset(X, y < 39) >> year1991 > Year1991 <- year1991[, c(1,2,3,5)] >> Year1991 > now I need help on whats the right R command to key to select(View) only ABC > of the Market COLUMN, which the other column values remains. > > Is it possible to do multiple separation at one time? or step by step > > Kindly advise :) > > > > -- > View this message in context: http://r.789695.n4.nabble.com/how-to-view-only-readings-of-a-selected-data-from-a-column-while-the-other-columns-remain-tp4643216.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.
John Kane
2012-Sep-15 13:26 UTC
[R] how to view only readings of a selected data from a column while the other columns remain
This looks a lot like homework. However here is a hint ABD1990 <- subset(xx, Year == 1990 & Market == "ABC") John Kane Kingston ON Canada> -----Original Message----- > From: jowe.tjioe.2012 at business.smu.edu.sg > Sent: Sat, 15 Sep 2012 02:22:42 -0700 (PDT) > To: r-help at r-project.org > Subject: [R] how to view only readings of a selected data from a column > while the other columns remain > > Hi Friends > > I am new here and have a problem > > Year Market Winner BID > 1 1990 ABC Apple 0.1260 > 2 1990 ABC Apple 0.1395 > 3 1990 EFG Pear 0.1350 > 4 1991 EFG Apple 0.1113 > 5 1991 EFG Orange 0.1094 > > > For each year and separately for the two markets (i.e.,ABC,EFG), examine > the > combined data for Apple and Pear on the bid price variable BID for > presence > of potential outliers.5 Identify instances where you observe the presence > of > potential outliers. > > I managed to separate the data by year only > > y <- c(1, seq(300)) >> year1991 <- subset(X, y < 39) >> year1991 > Year1991 <- year1991[, c(1,2,3,5)] >> Year1991 > > now I need help on whats the right R command to key to select(View) only > ABC > of the Market COLUMN, which the other column values remains. > > Is it possible to do multiple separation at one time? or step by step > > Kindly advise :) > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/how-to-view-only-readings-of-a-selected-data-from-a-column-while-the-other-columns-remain-tp4643216.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.____________________________________________________________ GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys Works with AIM?, MSN? Messenger, Yahoo!? Messenger, ICQ?, Google Talk? and most webmails
arun
2012-Sep-15 14:28 UTC
[R] how to view only readings of a selected data from a column while the other columns remain
HI, If I understand it correctly, try this: dat1<-read.table(text=" Year????? Market??????? Winner????????? BID ? 1990??????? ABC??????????? Apple????????? 0.1260 ? 1990??????? ABC??????????? Apple??????? 0.1395 ? 1990??????? EFG??????????? Pear????????? 0.1350 ? 1991??????? EFG??????????? Apple??????? 0.1113 ? 1991??????? EFG??????????? Orange????????? 0.1094 ",sep="",header=TRUE,stringsAsFactors=FALSE) dat1[with(dat1,{Year==1990 & Market=="ABC"}),] #or dat1[((grepl("ABC{0,1}",dat1$Market))&(grepl("1990",dat1$Year))),] #? Year Market Winner??? BID #1 1990??? ABC? Apple 0.1260 #2 1990??? ABC? Apple 0.1395 A.K. ----- Original Message ----- From: kangam3 <jowe.tjioe.2012 at business.smu.edu.sg> To: r-help at r-project.org Cc: Sent: Saturday, September 15, 2012 5:22 AM Subject: [R] how to view only readings of a selected data from a column while the other columns remain Hi Friends I am new here and have a problem ? Year? ? ? Market? ? ? ? Winner? ? ? ? ? BID 1? 1990? ? ? ? ABC? ? ? ? ? ? Apple? ? ? ? ? 0.1260 2? 1990? ? ? ? ABC? ? ? ? ? ? Apple? ? ? ? 0.1395 3? 1990? ? ? ? EFG? ? ? ? ? ? Pear? ? ? ? ? 0.1350 4? 1991? ? ? ? EFG? ? ? ? ? ? Apple? ? ? ? 0.1113 5? 1991? ? ? ? EFG? ? ? ? ? ? Orange? ? ? ? ? 0.1094 For each year and separately for the two markets (i.e.,ABC,EFG), examine the combined data for Apple and Pear on the bid price variable BID for presence of potential outliers.5 Identify instances where you observe the presence of potential outliers. I managed to separate the data by year only y <- c(1, seq(300))> year1991 <- subset(X, y < 39) > year1991Year1991 <- year1991[, c(1,2,3,5)]> Year1991now I need help on whats the right R command to key to select(View) only ABC of the Market COLUMN, which the other column values remains. Is it possible to do multiple? separation at one time? or step by step Kindly advise :) -- View this message in context: http://r.789695.n4.nabble.com/how-to-view-only-readings-of-a-selected-data-from-a-column-while-the-other-columns-remain-tp4643216.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.
David Winsemius
2012-Sep-15 15:23 UTC
[R] how to view only readings of a selected data from a column while the other columns remain
On Sep 15, 2012, at 2:22 AM, kangam3 wrote:> Hi Friends > > I am new here and have a problem > > Year Market Winner BID > 1 1990 ABC Apple 0.1260 > 2 1990 ABC Apple 0.1395 > 3 1990 EFG Pear 0.1350 > 4 1991 EFG Apple 0.1113 > 5 1991 EFG Orange 0.1094 > > > For each year and separately for the two markets (i.e.,ABC,EFG), examine the > combined data for Apple and Pear on the bid price variable BID for presence > of potential outliers.5 Identify instances where you observe the presence of > potential outliers.An identical question was posted on StackOverflow. Not only is there a no homework policy, there is also a no cross-posting policy. -- David.> > I managed to separate the data by year only > > y <- c(1, seq(300)) >> year1991 <- subset(X, y < 39) >> year1991 > Year1991 <- year1991[, c(1,2,3,5)] >> Year1991 > > now I need help on whats the right R command to key to select(View) only ABC > of the Market COLUMN, which the other column values remains. > > Is it possible to do multiple separation at one time? or step by step > > Kindly advise :) > > > > -- > View this message in context: http://r.789695.n4.nabble.com/how-to-view-only-readings-of-a-selected-data-from-a-column-while-the-other-columns-remain-tp4643216.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.David Winsemius, MD Alameda, CA, USA
Maybe Matching Threads
- "file changed as we read it" message during tar file creation on GlusterFS
- "file changed as we read it" message during tar file creation on GlusterFS
- "file changed as we read it" message during tar file creation on GlusterFS
- "file changed as we read it" message during tar file creation on GlusterFS
- "file changed as we read it" message during tar file creation on GlusterFS