データフレームの 2 つの列を一緒に貼り付けて、Excel に貼り付けたときに MS Excel がそれらの間に改行を挿入する方法。
以下のコードの結果は、MS Excel に貼り付けると、次の図のようになります。最後の列の「Qn1」と「Quebec」の間に改行があることに注意してください。
dfExample <- head( CO2 ) ## CO2 is in base datasets
dfExample$Vektor.With.Linebreak <- paste( df$Plant, df$Type, sep = "( linebreak here )" )
write.table( x = dfExample, file = "clipboard", sep = "\t", row.names = FALSE)