Are you running your code in RStudio? This will determine how the output is displayed when calling View().
I created a small test function:
test_view <- function() {
x <- matrix(1:4, nrow = 2)
View(x)
}
When I run test_view() in RStudio, the output opens in a new tab:

When I run test_view() in the Windows RGui, the output opens in a new window: