you can get a new data frame by
merge(qpiso, qplegit, all.x = TRUE, all.y = TRUE, by = "iso" )
Take the subtraction on the new data frame.




2014-06-29 11:24 GMT-05:00 Dr Eberhard Lisse <nospam@lisse.na>:

> I have two data frames like so
>
> > qpiso
>     iso requests
> 1    A1       20
> 2    A2      199
> 3    AD        5
> 4    AE      176
> ...
> 189  ZW       82
>
> > qplegit
>     iso requests
> 1    A2       36
> 2    AE        4
> 3    AM        2
> 4    AO        1
> ...
> 100  ZW        3
>
>
> I want to create another dataframe qpspam which contains all pairs
> from pqiso with the values for requests of qplegit being subtracted
> from those which exist in qpiso,
>
> ie
>     iso requests
> 1    A1       20
> 2    A2      163
> 3    AD        5
> 4    AE      172
> ...
> 189  ZW       79
>
> but don't know how to do this, and google isn't too helpful.
>
> As usual, a solution is preferred, but a pointer to where I can
> read this up is equally appreciated :-)-O
>
> el
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

