About subsetting data in R

Unlike Stata and other statistical package, running a cross tabulation on a subset of data in R is not a very straight forward thing. 
Let us assume the following scenario: assuming I want to cross tabulate Sex (M, F) by Tobacco (1 - Current, 2-Ex, 3-Never), but by excluding the Never smoking category. In stata a simple if Tobacco!=3 would suffice. However in R we need to subset the data prior to tabulating it:

```{r}
#subsetting the data
retinol1<-subset(retinol, tabac!=3)
table(retinol1$Sex, retinol1$tabac)
```

However, subsetting can be embedded directly if we are doing univariate analysis:

``` {r}
table(retinol$tabac[retinol$tabac!=3])

```

Update! Turns out that the function xtab has a subset option!

```
xtabs(~ Sex + tabac, retinol, subset = tabac != 3)
```

Introduction to the Analysis of Survival Data in the Presence of Competing Risks

 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4741409/