> I am traying to create a a column in my data frame  filled down with a
> number.
> 
> > df$newcolumn <-  number
> 
> How can I do it? I am considering use rep() but in this case it is
> necessary know the number of rows in each data base that I have and I would
> like to do it in a faster ( and more  elegant) way.

dframe$newcol <- rep(n, nrow(dframe))

Notes:
- 'df' is the density for the F distribution; safer to avoid giving data names 
of functions;
- 'nrow' returns the number of rows in an existing data frame or other object 
with dimensions.




*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
R-help@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.

Reply via email to