[R] Paste Funtion Help

Ulrik Stervbo ulrik.stervbo at gmail.com
Thu Feb 4 18:12:46 CET 2016


Hi Shivi,

I usually do

merge.salaries$name <- paste(merge.salaries$nameFirst,
merge.salaries$nameLast)

also if merge.salaries[, name:=paste("nameFirst","nameLast")] would work,
you would end up with a column full of "nameFirst nameLast".

Best,
Ulrik

On Thu, 4 Feb 2016 at 17:32 SHIVI BHATIA <shivi.bhatia at safexpress.com>
wrote:

> HI Team,
>
>
>
> Need help with the below syntax.
>
>
>
> merge.salaries[, name:=paste("nameFirst","nameLast")]. Here merge.salaries
> is the data set I have merged.
>
>
>
> There are 2 columns nameFirst and nameLast I need to merge these two into
> one and name as name however I can getting an error:
>
>
>
> Error in `[.data.frame`(merge.salaries, , `:=`(name, paste("nameFirst",  :
>
>   could not find function ":="
>
>
>
> Please advice.
>
>
>
> Thanks, Shivi
>
> Mb: 9891002021
>
>
>
> This e-mail is confidential. It may also be legally privileged. If you are
> not the addressee you may not copy, forward, disclose or use any part of
> it. If you have received this message in error, please delete it and all
> copies from your system and notify the sender immediately by return e-mail.
> Internet communications cannot be guaranteed to be timely, secure, error or
> virus-free. The sender does not accept liability for any errors or
> omissions.
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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]]



More information about the R-help mailing list