Hi
Can you explain rules for propagating values? I do not see any pattern.
Only when there is no Y in a line you want to fill all columns with either
T1D_noc or Ctrl_noc based on t1d_ptype.
I would start with narrowing the levels in last column as it seems to me
there is no difference between
Hello,
There are so many people posting answers that I'm curious and decided to try
one.
I don't know if this is it but it doesn't give an error and it reformats
your data
according to the rules in your original code.
#
nr <- dim(c1)[1]
nc <- dim(c1)[2]
c2 <- NULL
c2_row <- rep("", nc-1)
for(i i
On Fri, Dec 23, 2011 at 9:25 AM, 1Rnwb wrote:
> this is how the ouput from the code should be
What code might that be?
Readers of the R-help email list have no idea whatsoever what you're asking.
Please include context, as requested in the posting guide.
Sarah
> structure(list(HTN = 1:10, HT
this is how the ouput from the code should be
structure(list(HTN = 1:10, HTN_FDR = structure(c(4L, 2L, 1L,
2L, 3L, 1L, 1L, 2L, 3L, 2L), .Label = c("Ctrl_noc", "T1D_noc",
"T1D_oc", "T1d_w"), class = "factor"), Dyslipidemia = structure(c(3L,
2L, 1L, 2L, 4L, 1L, 1L, 2L, 4L, 2L), .Label = c("Ctrl_
Thanks Bill, the output of dput was very similar to your example, I was not
sure so did not put it on the post. however i uploaded the foo.txt file
which contains the part of the data.
sharad
--
View this message in context:
http://r.789695.n4.nabble.com/Help-with-code-tp4218989p4222947.html
Sen
here is the dump and the code once again, sorry for creating so much noise.
c1<-structure(list(HTN = structure(c(2L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L), .Label = c("", "Y"), class = "factor"), HTN_FDR = structure(c(2L,
1L, 1L, 1L, 2L,
Hi
>
> I do not know how to use dput, i am attaching the txt file for the data
dput(any.object)
puts a structure of this object to console. You can copy it to your email
and anybody can copy it back to R.
Or you can transfer the structure to file see
?dput, ?dget
> http://r.789695.n4.nabble.c
file c1.txt to your mail message.
We will see if my mailer breaks up the lines in my
example.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of 1Rnwb
> Sent:
I do not know how to use dput, i am attaching the txt file for the data
http://r.789695.n4.nabble.com/file/n4222616/foo.txt foo.txt
c1<-read.dlim('foo.txt')
c2<-c1
any_comp<-NULL
for( i in 1:dim(c1)[1])
{
num_comp<-0
for (j in 1:dim(c1)[2])
if (c1[i,j]==2) num_comp=num_comp+1 #"Y"
Hi
>
> hello gurus,
>
> i have a data frame like this
>HTN HTN_FDR Dyslipidemia CAD t1d_ptype[1:25]
> 1Y YY T1D
> 2 T1D
> 3 Ctrl_FDR
> 4
help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of Justin Haynes
> > Sent: Tuesday, December 20, 2011 11:54 AM
> > To: 1Rnwb
> > Cc: r-help@r-project.org
> > Subject: Re: [R] Help with code
> >
> > the short answer... which is a guess cau
ibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Justin Haynes
> Sent: Tuesday, December 20, 2011 11:54 AM
> To: 1Rnwb
> Cc: r-help@r-project.org
> Subject: Re: [R] Help with code
>
> the short answer.
the short answer... which is a guess cause you didn't provide a
reproducible example... is:
your column (i think its called t1d_ptype[1:25]) is a factor and using
factors is dangerous at best.
you can check with ?str.
see ?factor for how to convert back to strings and see if your code works.
Hi,
1) Still not reproducible because we do not have "E.csv"
2) The help list is not for homework questions. Many (most?)
professors and/or their TAs offer office hours where they are willing
to provide help and guidance (unless, of course, the assignment is
meant to encourage you to learn on you
R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)
Thanks for responding Josh. I got all the codes from my professor. Here is
what was required
##Load fPortfolio, PerformanceAnalytics, fOptions
Hi,
Please provide a *reproducible* example (as the posting guide
requests). It is also courteous to report your version of R and the
package which contains the chart.Regression() function. We can look
it up, but it saves time if you just say it.
Josh
On Sun, Jul 10, 2011 at 12:52 PM, finguy
Hi Randy,
> The SAS code for what I want to do is:
> /*
>
> if FTIStandKey=" NAH6253-003" then do;
>
> CoverType=" XSOP--C ";
>
> V_SpGrp="T";
>
> V_Origin="T";
>
> end;
>
I admit I didn't read all the sample code you added, but this is what
I *think* you're trying to accomplish.
myd
17 matches
Mail list logo