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
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
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
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
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
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])
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:
>
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
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
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
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[
<- -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
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
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
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
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
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
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
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
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
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
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
22 matches
Mail list logo