Functions of esProc/R/Python/Perl in Structured Data Process by Comparison :Chapter 11.Appending Records


    insert(0,value1:col1,value2:col2,……)        //It is very simple to complete it only with one statement






Appending a record to data frame in R will get you into a little more trouble, as a data frame with exactly same column names must be made up of the records to be appended, and then the two data frames are merged into one by using appropriate function.

    dd<- data.frame(name=c(‘Mr A’, ‘Mr B’, ‘Mr C’), subject=rep(1, 3), score=c(69, 71, 92))

    dd1 <- data.frame(name=c(‘Ms C’, ‘Ms D’), score=c(93, 99), subject=c(2, 2))

    dd2 <- rbind(dd, dd1)        #To merge the two data frames, whose column names must be fully consistent, but their column sequences can be different



About datathinker

a technical consultant on Database performance optimization, Database storage expansion, Off-database computation. personal blog at: datakeywrod, website: raqsoft
This entry was posted in Structured Data Process and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s