Question: This is not a major issue, but something that annoys me.

in R I change the value of a field in one column, depending on the value of another column:

```
my_df[my_df$column1 == "ONE", 'column2'] <- "My text"
my_df[my_df$column1 == "TWO", 'column2'] <- "My text"

```

and so on

If I try to shorten to one line by adding:

```
my_df[my_df$column1 == c("ONE", "TWO"), 'column2'] <- "My text"

```

I get a warning message:
"longer object length is not a multiple of shorter object length"

Is there an obvious way to do this without repeating the same line over and over?

Thanks for your help as always

Answer: 
Try this 

```
 const navigateAction = StackActions.reset({
            index: 0,
            key: null,
            actions: [NavigationActions.navigate({ routeName: 'Login' })]
        })
        this.props.navigation.dispatch(navigateAction)

```
I suggest you to use a `SwitchNavigator`, as suggested by the following official documentation: <https://reactnavigation.org/docs/en/auth-flow.html>

In your case, just replace the last StackNavigator with a SwitchNavigator:

```
const DashBoardStackNavigator = createStackNavigator({
      DashBoard: DashBoard,
      Second:Second,
      Third:Third
    })

const BottomTabNavigator = createBottomTabNavigator({
  DashBoardStackNavigator,
  Account,
  Report,
  Members
}})

const AppStackNavigator = createSwitchNavigator({
  Login: Login,
  BottomTabNavigator: BottomTabNavigator

})

export default createAppContainer(AppStackNavigator) 

```

Then just navigate to the Login:

```
this.props.navigation.navigate('Login')

```

It will automatically reset the stack when you switch between the bottomTabNavigator stack and the login stack, blocking all back actions between the two.