[R] some help

Rui Barradas ruipbarradas at sapo.pt
Sat Nov 3 20:34:29 CET 2012


Hello,

Without data it's not easy to answer to your questions, but

1. Use ?unlist. If the data is in a file, read it with ?read.table and 
the unlist the result. All columns will be stacked.

dat <- read.table(filename, ...)
unlist(dat)

2. At best confusing. But to divide a vector into groups use ?cut or 
?findInterval and then, to find the maximum and minimum of each group, 
?tapply or ?ave.

3. Regress what on what?


Provide a data example using dput for better answers:

dput( head(mydata, 30) )  # paste the output of this in a post


Hope this helps,

Rui Barradas
Em 03-11-2012 16:07, dattel_palme escreveu:
> Hi People!
>
> I have following concern consisting of some steps to do in R:
>
> I have an ascii file (table) consisting of many columns and rows.
> 1. I would like to order all values of the columns one under each other. It
> will begin with column 1, then column 2 under column 1, column 3 under
> column 2 etc. until at the end there is only 1 column. How do I do it?
>
> 2. Second problem is to make a scatterplot of two variables (I think after
> further explanation scatter plot itself will not be needed). I have two
> columns of two different variables (that I produces before), column 1 with
> variable 1 and column 2 with variable 2. I would like to order them by one
> variable and 0,01 interval (the varibale values will range between 0 and 1).
> >From each 0,01 interval (100 intervals) i want to pick the maximum and
> minimum value of variable 2.
>
> 3. From the obtained max and min of values of each interval i would like to
> make a linear least square regression.
>
> I hope someone can help me out!
> Thanks
> Stefan
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/some-help-tp4648316.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.




More information about the R-help mailing list