Append lines of text above or below the dataframe in r -
i have huge data frame (dimension:600000 x 6). 6 columns integer values representing different features each row. add 3 lines of text either above or below data frame common rows. possible insert lines of text below or above data frame?
for example: given dataframe,
name<-letters[1:10] length<-c(140,50,25,120,156,146,180,98,120,110) quality<-c(20,25,35,20,15,28,32,35,29,25) df<-data.frame(name,length,quality)
how insert 3 lines of text either above or below data frame,df:
no. of reads = 10 %at=32 %gc=30
the output should like:
name length quality 1 140 20 2 b 50 25 3 c 25 35 4 d 120 20 5 e 156 15 6 f 146 28 7 g 180 32 8 h 98 35 9 120 29 10 j 110 25 no. of reads = 10 %at=32 %gc=30
are looking this?
prettyprint <- function() { print(df) cat("no. of reads = 10", "\n%at=32", "\n%gc=30") } prettyprint()
the output looks this:
name length quality 1 140 20 2 b 50 25 3 c 25 35 4 d 120 20 5 e 156 15 6 f 146 28 7 g 180 32 8 h 98 35 9 120 29 10 j 110 25 no. of reads = 10 %at=32 %gc=30
Comments
Post a Comment