Displaying 5 results from an estimated 5 matches similar to: "Sort a column in a dataframe"
2009 Jul 31
1
Fill dataframe from a table according to a criteria
Deare R users
I am new to R.
What I want to do is explained below;-
I have table called States.Prob which is given below
Prob of States
Changes State1 State2 State3 State4
A Pa1 Pa2 Pa3 Pa4
B Pb1 Pb2 Pb3 Pb4
C Pc1 Pc2 Pc3 Pc4
D Pd1 Pd2 Pd3 Pd4
and I have a dataframe called
2009 Jul 28
1
Sort a dataframe on the column Date
Dear Users
I have a dataframe called mydata4 of the following order with the first
column as a date and the rest of the columns are numeric with rate.
Column 1 Rate1 : Rate 20
(PxMid)
01/01/2003
07/01/2001
----
----
--
I wish to sort this dataframe on the first col in ascending order.
I tried to do the following
mydata4<-mydata4[,order(mydata4$PxMid)]
This give an error.
Please help.
2013 May 11
1
How to repeat 2 functions in succession for 400 times? (microarray data)
Hi,
May be this helps:
?set.seed(24)
?mydata4<- as.data.frame(matrix(sample(1:100,10*38,replace=TRUE),ncol=38))
?dim(mydata4)
#[1] 10 38
?library(matrixStats)
res<-do.call(cbind,lapply(1:400, function(i) {permutation<-sample(mydata4); (rowMeans(permutation[,1:27])-rowMeans(permutation[,28:38]))/(rowSds(permutation[,1:27])+rowSds(permutation[,28:38]))} ))
?dim(res)
#[1]? 10 400
A.K.
2009 Aug 01
2
Add columns in a dataframe and fill them from another table according to a criteria
Deare R users
I am new to R.
What I want to do is explained below;-
I have table called States.Prob which is given below:-
This table gives the probabilities of the changes in the swap curve
depending on the state of the swap curve. I want to put these probabilities
in my dataframe mydata(given after the prob table).
Prob of States
Changes State1 State2 State3 State4
a
2007 Feb 24
1
Woolf's test, Odds ratio, stratification
Just a general question concerning the woolf test (package vcd), when we have
stratified data (2x2 tables) and when the p.value of the woolf-test is
below 0.05 then we assume that there is a heterogeneity and a common odds
ratio cannot be computed?
Does this mean that we have to try to add more stratification variables
(stratify more) to make the woolf-test p.value insignificant?
Also in the