Re: [R] Sorting data for multiple regressions

2007-08-06 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 04.08.2007 07:49:16: > Well, R has a by() function that does what you want, and its help page > contains an example of doing regression by group. > > (There are other ways.) E.g. you can split your data into list d.s <- split(data, data$site) and then use lapp

Re: [R] Sorting data for multiple regressions

2007-08-03 Thread Prof Brian Ripley
Well, R has a by() function that does what you want, and its help page contains an example of doing regression by group. (There are other ways.) On Fri, 3 Aug 2007, Paul Young wrote: > So I am trying to perform a robust regression (fastmcd in the robust > package) on a dataset and I want to per

[R] Sorting data for multiple regressions

2007-08-03 Thread Paul Young
So I am trying to perform a robust regression (fastmcd in the robust package) on a dataset and I want to perform individual regressions based on the groups within the data. We have over 300 sites and we want to perform a regression based on the day of week and the hour for every site. I was wonde

Re: [R] Sorting data frame by a string variable

2007-07-18 Thread S Ellison
Dimitri If you try > order(c("b","a","c")) [1] 2 1 3 or > sort(c("b","a","c")) [1] "a" "b" "c" You will see that sort() and order() DO respect character order. Your problem could be that your data frame variable is not a character but a factor (the default for read.table, for example) Check

Re: [R] Sorting data frame by a string variable

2007-07-17 Thread Peter Dalgaard
Dimitri Liakhovitski wrote: > I have a data frame MyData with 2 variables. > One of the variables (String) contains a string of letters. > How can I resort MyData by MyData$String (alphabetically) and then > save the output as a sorted data file? > > I tried: > > o<-order(MyData$String) > SortedDat

[R] Sorting data frame by a string variable

2007-07-17 Thread Dimitri Liakhovitski
I have a data frame MyData with 2 variables. One of the variables (String) contains a string of letters. How can I resort MyData by MyData$String (alphabetically) and then save the output as a sorted data file? I tried: o<-order(MyData$String) SortedData<-rbind(MyData$String[o], MyData$Value[o])

Re: [R] sorting data

2007-06-21 Thread Moshe Olshansky
Try ReadWriteXls package from CRAN. --- dala <[EMAIL PROTECTED]> wrote: > > I have a 2 columns, Date and Number, in Excel. > I copy and paste them into Notepad. > I can use scan() to import the file but how do I > plot this data with Date as > the x-axis? > -- > View this message in context: >

Re: [R] sorting data

2007-06-21 Thread ONKELINX, Thierry
ppositions. ~M.J.Moroney > -Oorspronkelijk bericht- > Van: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Namens dala > Verzonden: donderdag 21 juni 2007 15:54 > Aan: r-help@stat.math.ethz.ch > Onderwerp: [R] sorting data > > > I have a 2 columns, Date and Number, in

[R] sorting data

2007-06-21 Thread dala
I have a 2 columns, Date and Number, in Excel. I copy and paste them into Notepad. I can use scan() to import the file but how do I plot this data with Date as the x-axis? -- View this message in context: http://www.nabble.com/sorting-data-tf3958889.html#a11233613 Sent from the R help mailing l

[R] sorting data help

2007-04-24 Thread Chris Linton
I am trying to create a 2x2xk contingency table. The variables are GDP and an income inequality statistic with year being the k levels. I want to eventually run a loglinear model with the data. Currently the data is organized by either year or country. example CountryYear log(GDP)sqr

Re: [R] sorting data in R

2007-04-20 Thread Kevin Wright
s) > pos <- pos+1+nchar(vars[i]) > if(is.factor(dat[,vars[i]])){ > if(varsign=="-") > calllist[[i]] <- -rank(dat[,vars[i]]) > else > calllist[[i]] <- rank(dat[,vars[i]]) > } > else { > if(varsign=="-") > calllist[

Re: [R] sorting data in R

2007-04-20 Thread gyadav
<- -rank(dat[,vars[i]]) else calllist[[i]] <- rank(dat[,vars[i]]) } else { if(varsign=="-") calllist[[i]] <- -dat[,vars[i]] else calllist[[i]] <- dat[,vars[i]] } } dat[do.call("order",calllist),] } elyakhl

Re: [R] sorting data in R

2007-04-20 Thread Julien Barnier
Hi, > I'd like know how to sort a data frame in R for example how I should > do to sort by Catholic with swiss data frame like below It's in the FAQ : http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-sort-the-rows-of-a-data-frame_003f HTH, Julien -- Julien Barnier Groupe de recherche s

[R] sorting data in R

2007-04-20 Thread elyakhlifi mustapha
hello, I'd like know how to sort a data frame in R for example how I should do to sort by Catholic with swiss data frame like below thanks Fertility Agriculture Examination Education Catholic Infant.Mortality Courtelary80.217.0 1512 9.96

Re: [R] Sorting Data?

2004-05-28 Thread Martin Klaffenboeck
Am 28.05.2004 15:18:58 schrieb(en) Jonathan Baron: >Also the other things. > >I have to test the hypothesis: Does a daugther answer the questions >(semantic differential) more equal the own mother and more different to >the mothers of the other daugthers. I don't think this is a trivial problem at

Re: [R] Sorting Data?

2004-05-28 Thread Jonathan Baron
On 05/28/04 12:21, Martin Klaffenboeck wrote: >Am 27.05.2004 22:43:02 schrieb(en) Jonathan Baron: >> On 05/27/04 21:58, Martin Klaffenboeck wrote: >> >Hello, >> > >> >Im reading through some manuals, but I cannot find my answer. >> > >> >I have a file containing many data: >> > >> >Vpn CodeFami

Re: [R] Sorting Data?

2004-05-28 Thread Martin Klaffenboeck
Am 27.05.2004 22:43:02 schrieb(en) Jonathan Baron: On 05/27/04 21:58, Martin Klaffenboeck wrote: >Hello, > >Im reading through some manuals, but I cannot find my answer. > >I have a file containing many data: > >Vpn CodeFamily Age F1 F2 ... F17 >1 1 M 46 1

Re: [R] Sorting Data?

2004-05-28 Thread Martin Klaffenboeck
Am 27.05.2004 22:17:04 schrieb(en) Patrick Burns: First comment: "F" is a bad name to use for an object as it masks the commonly used meaning of FALSE. Oh, thanks, I just took F because 'Fragebogen' is such a long variable. But you are right, I will change that. You'll probably get some better

Re: [R] Sorting Data?

2004-05-28 Thread Martin Klaffenboeck
Am 27.05.2004 22:11:04 schrieb(en) Berton Gunter: Your question does not make a lot of sense to me. If you only want to compute distances between mothers and THEIR daughters, you cannot have a matrix, because different mothers have different numbers of daughters. Thats true, but we took

Re: [R] Sorting Data?

2004-05-27 Thread Jonathan Baron
OK. Maybe 2 errors. I already found one: On 05/27/04 16:43, Jonathan Baron wrote: >Sumdiffs <- rowMeans(Mothers[,-(1:4)]-Daughters[,-(1:4)]) should be Sumdiffs <- rowMeans(Mothers[,-(1:4)])-rowMeans(Daughters[,-(1:4)]) __ [EMAIL PROTECTED] mailing li

Re: [R] Sorting Data?

2004-05-27 Thread Jonathan Baron
On 05/27/04 21:58, Martin Klaffenboeck wrote: >Hello, > >Im reading through some manuals, but I cannot find my answer. > >I have a file containing many data: > >VpnCodeFamily Age F1 F2 ... F17 >1 1 M 46 1 2 ... 1 >2 1 D

[R] Sorting Data?

2004-05-27 Thread Martin Klaffenboeck
Hello, Im reading through some manuals, but I cannot find my answer. I have a file containing many data: Vpn CodeFamily Age F1 F2 ... F17 1 1 M 46 1 2 ... 1 2 1 D 18 3 2 ... 4 3 2 M