Hi Mauricio, Try the following:
# using the iris data require(MASS) x <- iris x[x[, 5] == 'setosa',] # and your data dframe[dframe[, 1] == "FY11_Q4", ] HTH, Jorge On Thu, Jun 9, 2011 at 3:34 PM, Mauricio Cornejo <> wrote: > Hi, > > I have a data frame with column names "1", "2", "3", ... and I'd like to > extract > a subset based on the values in the first column. None of the methods I > tried > worked (below). > > > x <- subset(dframe, 1 = = "My Text") > x <- subset(dframe, "1" = = "My Text") > x <- subset(dframe, names(dframe)[1] = = "My Text") > Q <- dframe[1 = = "FY11_Q4",] > Q <- dframe['1'=="FY11_Q4",] > Q <- dframe[names(dframe)[1]=="FY11_Q4",] > > > Might anyone have a suggestion? > > Many thanks, > Mauricio > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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. > [[alternative HTML version deleted]] ______________________________________________ R-help@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.