Dear all users I want to write a vector with one column and just NA values and nrow=200 when i write X=numeric(NA) is not correct how can i do this please? Regards
generate ordered categorical variable in R
4 messages · thanoon younis, Boris Steipe, Jeff Newmiller
x <- rep(NA, 200) For all cases I can think of, that is enough. If you MUST have a matrix with one column and two hundred rows, set: dim(x) <- c(200,1) B.
On Sep 17, 2015, at 9:40 AM, thanoon younis <thanoon.younis80 at gmail.com> wrote:
Dear all users I want to write a vector with one column and just NA values and nrow=200 when i write X=numeric(NA) is not correct how can i do this please? Regards [[alternative HTML version deleted]]
______________________________________________ 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.
... and, less explicitly, but more compactly: y <- array(dim=c(200,1)) B.
On Sep 17, 2015, at 10:07 AM, Boris Steipe <boris.steipe at utoronto.ca> wrote:
x <- rep(NA, 200) For all cases I can think of, that is enough. If you MUST have a matrix with one column and two hundred rows, set: dim(x) <- c(200,1) B. On Sep 17, 2015, at 9:40 AM, thanoon younis <thanoon.younis80 at gmail.com> wrote:
Dear all users I want to write a vector with one column and just NA values and nrow=200 when i write X=numeric(NA) is not correct how can i do this please? Regards [[alternative HTML version deleted]]
______________________________________________ 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.
______________________________________________ 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.
Vectors have no columns or rows.
rep( NA, 200 )
If you need a matrix, you have to turn it into one:
matrix( rep( NA, 200 ), ncol=1 )
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
On September 17, 2015 6:40:34 AM PDT, thanoon younis <thanoon.younis80 at gmail.com> wrote:
Dear all users I want to write a vector with one column and just NA values and nrow=200 when i write X=numeric(NA) is not correct how can i do this please? Regards [[alternative HTML version deleted]]
______________________________________________ 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.