Displaying 20 results from an estimated 20000 matches similar to: "row names and identical"
2011 Feb 17
2
sort by column and row names
Hello, All,
How can one sort on column and row names. For example:
How can this
X1 X3 X2
X1 1 0 0
X3 0 1 0
X2 0 0 1
become this?
X1 X2 X3
X1 1 0 0
X2 0 1 0
X3 0 0 1
Thank you for your time!
Jim
[[alternative HTML version deleted]]
2017 Jul 16
0
Arranging column data to create plots
On Sat, 15 Jul 2017, Michael Reed via R-help wrote:
> Dear All,
>
> I need some help arranging data that was imported.
It would be helpful if you were to use dput to give us the sample data
since you say you have already imported it.
> The imported data frame looks something like this (the actual file is
> huge, so this is example data)
>
> DF:
> IDKey X1 Y1 X2 Y2
2012 Sep 12
3
how to create a substraction matrix (subtract a row of every column from the same row in other columns)
Hello
I have data like this
x1 x2 x3 x4 x5
I want to create a matrix similar to a correlation matrix, but with the
difference between the two values, like this
x1 x2 x3 x4 x5
x1 x2-x1 x3-x1 x4-x1 x5-x1
x2 x3-x2 x4-x2 x5-x2
x3 x4-x3 x5-x3
x4 x5-x4
x5
Then I
2023 Aug 19
1
Determining Starting Values for Model Parameters in Nonlinear Regression
Thank you so much Dr. Nash, I truly appreciate your kind and valuable
contribution.
Cheers,
Paul
El El s?b, 19 de ago. de 2023 a la(s) 3:35 p. m., J C Nash <
profjcnash at gmail.com> escribi?:
> Why bother. nlsr can find a solution from very crude start.
>
> Mixture <- c(17, 14, 5, 1, 11, 2, 16, 7, 19, 23, 20, 6, 13, 21, 3, 18, 15,
> 26, 8, 22)
> x1 <- c(69.98, 72.5,
2008 Mar 12
3
Converting a data frame with values into a matrix/
Dear Group,
I have a data frame like the following:
x <- c("Mike","A",0.01)
x1 <- c("Carl","A",0.2)
x2 <- c("Gene","C",0.3)
x3 <- c("James","A",-0.3)
x4 <- c("Dough","B",0)
xx <- rbind(x,x1,x2,x3,x4)
colnames(xx)<-c("Name","Class","NES")
xx
2013 Apr 13
1
how to add a row vector in a dataframe
Hi,
Using S=1000
and
simdata <- replicate(S, generate(3000))
#If you want both "m1" and "m0" #here the missing values are 0
res1<-sapply(seq_len(ncol(simdata.psm1)),function(i) {x1<-merge(simdata.psm0[,i],simdata.psm1[,i],all=TRUE); x1[is.na(x1)]<-0; x1})
res1[,997:1000]
#????? [,1]???????? [,2]???????? [,3]???????? [,4]???????
#x1??? Numeric,3000 Numeric,3000
2023 Aug 20
1
Determining Starting Values for Model Parameters in Nonlinear Regression
The cautions people have given about starting values are worth heeding. That nlxb() does well in many cases is useful,
but not foolproof. And John Fox has shown that the problem can be tackled very simply too.
Best, JN
On 2023-08-19 18:42, Paul Bernal wrote:
> Thank you so much Dr. Nash, I truly appreciate your kind and valuable contribution.
>
> Cheers,
> Paul
>
> El El
2009 Feb 23
2
Formula that includes previous row values
Hi R users,
Is there an easy way in R to generate the results table below using table 1
and the formula (simplified version of the real problem)? It would be easy
if I knew the R equivalent of SAS's retain function, but could not find one.
Thanks in Advance for any help!
table1:
ID X2 X3
1.00 1.00 0
2.00 0.00
3.00 1.00
4.00 3058
5.00 0.00
6.00 6.00
Formula: X3 = x2 + (.24 *
2023 Aug 19
1
Determining Starting Values for Model Parameters in Nonlinear Regression
Dear friends,
Hope you are all doing well and having a great weekend. I have data that
was collected on specific gravity and spectrophotometer analysis for 26
mixtures of NG (nitroglycerine), TA (triacetin), and 2 NDPA (2 -
nitrodiphenylamine).
In the dataset, x1 = %NG, x2 = %TA, and x3 = %2 NDPA.
The response variable is the specific gravity, and the rest of the
variables are the predictors.
2012 Dec 04
3
reformatting some data
Hello,
I am trying to reformat some data so that it is organized by group in the
columns. The data currently looks like this:
group X3.Hydroxybutyrate X3.Hydroxyisovalerate ADP
347 4 4e-04 3e-04 5e-04
353 3 5e-04 3e-04 6e-04
359 4 4e-04 3e-04
2013 Aug 09
1
a fast table() for the 1D case
Hi,
table1D() below can be up to 60x faster than base::table() for the 1D
case. Here are the detailed speedups compared to base::table().
o With a logical vector of length 5M: 11x faster
(or more if 'useNA="always"')
o With factor/integer/numeric/character of length 1M and 9 levels
(or 9 distinct values for non-factors):
2011 Nov 30
3
how to call a function for each row
Hi
I have a data-frame which look like this
X1 X2 X3
1 3 5
2 4 6
3 6 1
I want to apply a formula Y=6*X1 + 7*X2 + 8*X3 for every row
Thanks in Advance
--
View this message in context: http://r.789695.n4.nabble.com/how-to-call-a-function-for-each-row-tp4122906p4122906.html
Sent from the R help mailing list archive at Nabble.com.
2012 Aug 01
2
sub setting a data frame with binomial responses
Hi everyone,
Let me have a dataframe named ?mydata? and created as below,
*> n=c(5,5,5,5) #number of trils
> x1=c(2,3,1,3) ) #number of successes
> x2=c(5,5,5,5) #number of successes
> x3=c(0,0,0,0) #number of successes
> x4=c(5,0,5,0) #number of successes
> mydata=data.frame(n,x1,x2,x3,x4)
> mydata*
n x1 x2 x3 x4
1 5 2 5 0 5
2 5 3 5 0 0
3 5 1 5 0 5
4 5 3 5 0
2012 Oct 08
3
Removing header from a matrix
I have three column vectors (X1, X2, X3).
X1 X2 X3
20 25 40
100 90 80
I want to put them as one matrix of dimention 2 by 3, but remove headers(X1,X2,X3) from the matrix. I wrote
as follows
U<-cbind (X1,X2,X3)
the headers are there. I need help please. Thanks
Dereje
[[alternative HTML version deleted]]
2013 Jan 07
6
Refer to previous row
Hi all,
I have a very basic doubt -- but still, I am a newby!
My question is about referring to the previous row: in a sample as the
following...
ID X1 X2
1 A 12
2 A 6
3 A 10
1 B 17
2 B 19
1 C 22
1 D 13
2 D 19
3 D 21
... I would like to create a dummy variable equal to 1 whenever the
value of ID of the current row is lower or equal than the value of ID
of
2018 Feb 20
0
Take the maximum of every 12 columns
Hi Milu,
byapply(df, 12, function(x) apply(x, 1, max))
You might also be interested in the matrixStats package.
Best,
Ista
On Tue, Feb 20, 2018 at 9:55 AM, Miluji Sb <milujisb at gmail.com> wrote:
> Dear all,
>
> I have monthly data in wide format, I am only providing data (at the bottom
> of the email) for the first 24 columns but I have 2880 columns in total.
>
> I
2012 Apr 20
4
Problem with Tukey test
I'm new using R im trying to do a tukey test, but when i see the results the
p value results in NA im guessing its because i have missing values but im
not sure how to fix it
AnovaModel.2 <- aov(area ~ trat, data=apilados)
> summary(AnovaModel.2)
Df Sum Sq Mean Sq F value Pr(>F)
trat 4 11847 2961.76 9.9905 1.500e-06 ***
Residuals 76 22531 296.46
2014 Oct 07
1
Conditional Data Manipulation -Cumulative Product
Hello,
I have three datasets StartSignals, MainData, StopSignals and need to compound the data for each variable in MainData over dates that fall between the Start and Stop signals. (Stop signals are common and the same to all X1:X5 variables). Please see sample below:
The one way I was thinking of doing this project was to setup a nested "FOR" loop and go through the three data
2006 Jul 08
2
String mathematical function to R-function
hello
I make a subroutine that give-me a (mathematical)
function in string format.
I would like transform this string into function ( R
function ).
thanks for any tips.
cleber
#e.g.
fun_String = "-100*x1 + 0*x2 + 100*x3"
fun <- function(x1,x2,x3){
return(
############
evaluation( fun_String )
############
)
True String mathematical function :-( :-(
> nomes
[1]
2010 Aug 13
2
Fw: Error in rowSums REPOST
For the query below I have also included the follwing information. Thanks for
your replies
> str(FeaturePresenceMatrix)
chr [1:65530, 1:40] "0" "0" "0" "0" "1" "0" "0" "0" "0" ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:65530] "4" "5" "6" "7" ...