2

I have data of about hospital i.e. its patient details,location. Now I have to exclude hospital from table which are lies on State store in Vector (which may be vary according to the condition) and store remaining hospital on another table. How can I achieve this in R. As I'm new bin please suggest me if any function there to do this task.

>test <- read.csv("outcome-of-care-measures.csv", colClasses = "character")
>test[, 11] <- as.numeric(outcome[, 11])
>test2 <- table(outcome$State)
>exc_state <- names(test2[test2 < 20]) 

Now remove row with all state name store on exc_State from table and store on another table named table2.

Lionel
  • 604
  • 9
  • 26
  • 2
    What have you tried? Also please read [this post](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). It outlines best practices for asking questions here. – Justin Feb 01 '13 at 17:49
  • 1
    This question is poorly written and sparse on the necessary details. It will help if you provide example data for the data frame 'outcome' and include an example of what the final result should look like. – Dinre Feb 01 '13 at 17:57
  • @Justin & Dinre I agree with both of you as I'm now starting to learn R and hence to ask question related to R. From after I will follow your suggestion... – Lionel Feb 01 '13 at 18:00

1 Answers1

0

It is not clear what you want( without a reproducible example)

   dat <- as.data.frame(test2)              ## convert to a data.frame
   test1 <- dat[dat$test2 %in% exc_state,]  ## get all row matching exc_state
agstudy
  • 119,832
  • 17
  • 199
  • 261