Arun, thanks for clearing that up. I was making assumptions about R that I
shouldnât have when it comes to column(variable) assignments. Hope everyone
has a good Monday. BNC
From: arun kirshna [via R] [mailto:ml-node+s789695n4671473...@n4.nabble.com]
Sent: Friday, July 12, 2013 11:59 PM
. Thanks. I really appreciate your (everyone's)
help. BNC
-Original Message-
From: arun [mailto:[hidden
email]/user/SendEmail.jtp?type=nodenode=4671365i=3]
Sent: Thursday, July 11, 2013 4:29 PM
To: Crombie, Burnette N
Cc: R help
Subject: Re: [R] create new matrix from user-defined function
AK, I decided to convert your âwithâ statement back to index-by-number, and
I did look up the ?with help info, but Iâm confused about my replacement code
below. I got the wrong answer (R didnât apply the function to my column 1
variable âA_CaseIDâ). What am I doing wrong? Do I
6 112
with(dat3,7)
#[1] 7
with(dat3,`7`)
#Error in eval(expr, envir, enclos) : object '7' not found
A.K.
- Original Message -
From: bcrombie bcrom...@utk.edu
To: r-help@r-project.org
Cc:
Sent: Friday, July 12, 2013 4:45 PM
Subject: Re: [R] create new matrix from user-defined function
: Wednesday, July 10, 2013 12:19 PM
To: [hidden email]/user/SendEmail.jtp?type=nodenode=4671267i=1
Subject: [R] create new matrix from user-defined function
#Let's say I have the following data set:
dat3 = data.frame(A_CaseID = c(1881, 1882, 1883, 1884, 1885),
B_MW_EEsDue1 = c(2, 2, 1
] TRUE
setnames(res3,A,MW_EEsDue_ERRORS)
identical(res1,as.data.frame(res3))
#[1] TRUE
A.K.
- Original Message -
From: bcrombie bcrom...@utk.edu
To: r-help@r-project.org
Cc:
Sent: Thursday, July 11, 2013 3:54 PM
Subject: Re: [R] create new matrix from user-defined function
Dan and Arun
Oh, also thanks for the speed comparisons. Missed that in my first
read-through. Very interesting and informative. BNC
-Original Message-
From: Crombie, Burnette N
Sent: Thursday, July 11, 2013 4:40 PM
To: 'arun'
Cc: R help
Subject: RE: [R] create new matrix from user-defined
, Burnette N bcrom...@utk.edu
To: arun smartpink...@yahoo.com
Cc: R help r-help@r-project.org
Sent: Thursday, July 11, 2013 4:40 PM
Subject: RE: [R] create new matrix from user-defined function
You understood me perfectly, and I agree is it easier to index using numbers
than names. I'm just afraid if my
Hi,
You could try:
mat1-matrix(dat3[rowSums(dat3[,2:3])!=dat3[,4],1],ncol=1,dimnames=list(NULL,MW_EEsDue_ERRORS))
mat1
# MW_EEsDue_ERRORS
#[1,] 1882
#[2,] 1884
#[3,] 1885
A.K.
#Let's say I have the following data set:
dat3 = data.frame(A_CaseID =
#Let's say I have the following data set:
dat3 = data.frame(A_CaseID = c(1881, 1882, 1883, 1884, 1885),
B_MW_EEsDue1 = c(2, 2, 1, 4, 6),
C_MW_EEsDue2 = c(5, 5, 4, 1, 6),
D_MW_EEsDueTotal = c(7, 9, 5, 6, 112))
dat3
# A_CaseID B_MW_EEsDue1
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of bcrombie
Sent: Wednesday, July 10, 2013 12:19 PM
To: r-help@r-project.org
Subject: [R] create new matrix from user-defined function
#Let's say I have the following data set
11 matches
Mail list logo