Hi tj,

May be the following?

x <- 1:5
NA*x

rep(NA, length(x))

HTH,
Jorge


On Mon, Mar 22, 2010 at 9:05 PM, tj <> wrote:

>
> Hi,
>
> How can I create an NA?
> for example, i have this program but it has errors
>
> > x=scan()
> 1: 1 2 3 4 5
> 6:
> Read 5 items
> > "na"*x
> Error in "na" * x : non-numeric argument to binary operator
>
>
> what should I multiply x so that I will get an NA? And I really need to
> multiply that with my x vector.
> I need this output: (na,na,na,na,na)
>
> Thank you for your time and help!=)
> --
> View this message in context:
> http://n4.nabble.com/Create-NA-tp1678543p1678543.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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]]

