'How do I remove all variable names and leave values only in my export in R?

I have this code:

library(openxlsx)
library(tidyverse)

rid <- (c(1:20,NA))
RISN <- (c(1:20, NA))
Fake <- (c(1:20, NA))

df <- tibble(rid, RISN, Fake)

df <- df %>% filter(!is.na(rid) & !is.na(RISN)) %>% select(RISN,rid)

write.xlsx(df, "~/Downloads/df_test.xlsx", asTable = FALSE)

I need my export to appear like this with the "rid" and "RISN" column names removed. I'm not sure if this is possible. Does anyone know a way around this? I suspect I need to convert it from a tibble type to something else, but I've tried matrix and it's not working for me.

The columns should contain no headers



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source