[R] paste dataframe

ggrothendieck@yifan.net ggrothendieck at yifan.net
Wed Apr 10 19:44:18 CEST 2002


apply(array(c(A,B),dim=c(2,2,2)),c(1,2),function(x)paste(x[1],x[2]))

On 11 Apr 2002 at 3:24, Olivier Martin wrote:

> Hi all,
> Assume i have two dataframes A and B with characters objects
> for example,
> A<-rbind(c("the","is"),c("and","!"))
> B<-rbind(c("car","red"),c("blue","!"))
> 
> and i would like to obtain the C dataframe
> C<-rbind(c("the car", "is red"),c("and blue","!!"))
> 
> What is the solution without loops ?

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list