[R] Writing values to vectors

Joshua Wiley jwiley.psych at gmail.com
Mon Mar 14 09:48:02 CET 2011


Hi Kumaraguru,

Just assign the output to a variable name, like:

vec1 <- degreeDist(data1)
vec2 <- degreeDist(data2)
vec3 <- degreeDist(data3)

HTH,

Josh

On Sun, Mar 13, 2011 at 11:32 PM, kparamas <kparamas at asu.edu> wrote:
> Hi,
>
> I am calculating,inside a function, clustering coefficient, average path
> length and diameter
> of a graph.
>
> I want to write them to 3 different vectors. Please let me know how to do
> that.
>
> degreeDist = function()
> {
> ..
> #calculating the values
> ....
> }
>
> degreeDist(data1)
> degreeDist(data2)
> degreeDist(data3)
>
> Thanks,
> Kumaraguru
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Writing-values-to-vectors-tp3353220p3353220.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list