[R] data.fram zero's

Dimitris Rizopoulos d.rizopoulos at erasmusmc.nl
Thu Apr 9 15:01:16 CEST 2009


well, you can first create a matrix and then turn into a data frame, e.g.,

mat <- matrix(0, 5, 10)
as.data.frame(mat)


I hope it helps.

Best,
Dimitris


Duijvesteijn, Naomi wrote:
>    Hi all,
> 
> 
>    A simple question which I don’t seem to be able to solve:
> 
> 
>    I want to make a data.frame of 360 rows and 94228 column with only zero’s
>    without having to type all these zero’s ;-)
> 
> 
>    What is the easiest method?
> 
> 
>    Thanks,
> 
>    Naomi
> 
>    
>    
>    
>    Disclaimer:  De  informatie opgenomen in dit bericht (en bijlagen) kan
>    vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde(n).
>    Indien u dit bericht ten onrechte ontvangt, wordt u geacht de inhoud niet te
>    gebruiken, de afzender direct te informeren en het bericht te vernietigen.
>    Aan dit bericht kunnen geen rechten of plichten worden ontleend.
> 
>    ----------------------------------------------------------------------------
>    ----------------------------
> 
>    Disclaimer: The information contained in this message may be confidential
>    and is intended to be exclusively for the addressee. Should you receive this
>    message unintentionally, you are expected not to use the contents herein, to
>    notify the sender immediately and to destroy the message. No rights can be
>    derived from this message.
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at 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.

-- 
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center

Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014




More information about the R-help mailing list