Suggest i have a data.frame:

```
df<-mtcars

```

What I now want to do is select the row **before** `rowname ="Valiant"` and the row **after** `rowname = "Datsun 710"`
so that the **output looks like**:

```
                   mpg cyl disp  hp drat   wt  qsec vs am gear carb
Hornet Sportabout 18.7   8  360 175 3.15 3.44 17.02  0  0    3    2
Hornet 4 Drive 2  21.4   6  258 110 3.08 3.215 19.44  1  0    3    1

```

**What I have tried so far:**

```
select <- df[which(rownames(df)=="Valiant")-1,] | df[which(rownames(df)=="Datsun 710")+1, ] 

select <- df[ which((rownames(df) == "Valiant") -1 | (rownames(df)== "Datsun 710") +1) , ]

select <- df[(rownames(df) == "Valiant")-1 | (rownames(df) == "Datsun 710")+1, ] 

select <- df[ (which(rownames(df) == "Valiant") -1) | (which(rownames(df) == "Datsun 710") +1),  ]

```

But **non of them worked** although the **single code fragments work**:

```
> df[which(rownames(df)=="Valiant")-1,]
                   mpg cyl disp  hp drat   wt  qsec vs am gear carb
Hornet Sportabout 18.7   8  360 175 3.15 3.44 17.02  0  0    3    2
> df[which(rownames(df)=="Datsun 710")+1, ]
                mpg cyl disp  hp drat    wt  qsec vs am gear carb
Hornet 4 Drive 21.4   6  258 110 3.08 3.215 19.44  1  0    3    1

```

What I'm I missing?