While the <- operator looks like something special, when used to replace rownames(), it’s actually a shortcut for the `rownames<-`() function, which you can just call directly in the pipe:
data.frame(a=letters[1:5], b=1:5, c=LETTERS[1:5]) %>%
`rownames<-`(.[,1])
a b c
a a 1 A
b b 2 B
c c 3 C
d d 4 D
e e 5 E
This is the function you’re actually always using when you assign rownames:
# When you write this
rownames(df) <- c(1:5)
# What R is actually doing is running this function:
`rownames<-`(df, c(1:5))
You can do the same thing with `colnames<-`() and `names<-`() as well
The backtick character (`) defines something as a symbol, even if it otherwise contains characters that are illegal in a symbol. Enclosing it in backticks tells R that you are running a function called rownames<- and passing in .[,1] as an argument. Without it, R would stop reading the function name when it reaches the < sign, and look for the normal rownames function, which is not what we want here.
Read this question for more detail on the backtick syntax: What do backticks do in R?