search for: farnoosh

Displaying 20 results from an estimated 27 matches for "farnoosh".

2012 Oct 23
3
frequency
...a data as follow: ID    Visit xa1 xa2 yb1 yc23 yb33   I want to look at frequency of visit for ID and create a new column as response .  For example my response would be 2 for x and 3 for y. I think I need to write a loop, but I don't know how. I really appreciate your help. Thanks a lot. Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2017 Jun 28
4
Different date formats in one column
Hi,? I have a data set with various date formats in one column and not sure how to unify it.Here is a few formats: 02091702/22/170221201703/17/160015-08-239/2/1500170806May-2-201522-March-2014 I tried parse_date_time from lubridate library but it failed.Thanks so much.?Best,Farnoosh [[alternative HTML version deleted]]
2016 Mar 29
2
Filtering based on the occurrence
...uot;2 2011-01-02 ? ?B","2 2011-01-03 ? ?C","3 2011-01-05 ? ?D","3 2011-01-06 ? ?A","4 2011-01-07 ? ?F","4 2011-01-08 ? ?G","5 2011-01-10 ? ?F","5 2011-01-11 ? ?A","5 2011-01-12 ? ?D")?Thank you tons for your help.? Farnoosh [[alternative HTML version deleted]]
2017 Jun 29
0
Different date formats in one column
...}$", dta$DtStr, perl=TRUE ) dta$Dt[ idx ] <- as.Date( dta$DtStr[ idx ], format="%m%d%y" ) idx <- grepl( "^([1-9]|1[0-2])/[0-9]{1,2}/[0-9]{2}$", dta$DtStr, perl=TRUE ) dta$Dt[ idx ] <- as.Date( dta$DtStr[ idx ], format="%m/%d/%y" ) On Wed, 28 Jun 2017, Farnoosh Sheikhi via R-help wrote: > Hi,? > I have a data set with various date formats in one column and not sure how to unify it.Here is a few formats: > 02091702/22/170221201703/17/160015-08-239/2/1500170806May-2-201522-March-2014 > I tried parse_date_time from lubridate library but it faile...
2017 Jun 29
0
Different date formats in one column
Hey, Are all the dates connected? So no comma or space btw? Regards, Christoph > On 29 Jun 2017, at 2:02 pm, Farnoosh Sheikhi via R-help <r-help at r-project.org> wrote: > > Hi, > I have a data set with various date formats in one column and not sure how to unify it.Here is a few formats: > 02091702/22/170221201703/17/160015-08-239/2/1500170806May-2-201522-March-2014 > I tried parse_date_tim...
2017 Jun 29
1
Different date formats in one column
Thanks Jeff. This is a nice way of solving this problem. What about the cases with 0015-02-21?Many thanks.?Best,Farnoosh On Wednesday, June 28, 2017 10:49 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: I doubt your actual file looks like the mess that made it to my email software (below) because you posted HTML-format email. Read the Posting Guide, and in particular figure out how to send...
2013 Jan 28
2
Pivot
...a set as follow: X         Z x1        102 x2        102 x2        102 x2        77 x3        23   I need to pivot this data as follows and assign the values based on frequency of column Z: X       Z.102   Z.77 Z.23 x1          1        0        0 x2          21  0 x3         00  1 Thanks. Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2012 Oct 08
2
converting DOB format to age
Hi, I have a column of DOB in mm/dd/yyyy. I want to convert this format to age. Thanks a lot.   Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2012 Dec 12
1
Subset of Data
...of 5000 in 3500. I want to choose specific variables such as proc1 to proc1000 and Lab1 to Lab1600 and put it into a new matrix to run some correlation analysis. Since I have 3500 variables, I don't know from what column my lab or procedures start. I really appreciate your help. Thanks.   Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2013 Aug 26
1
Loop for converting character columns to Numeric
..." "9" ... dat1[,2:3]<- lapply(dat1[,2:3],as.numeric) ?str(dat1) #'data.frame':??? 5 obs. of? 3 variables: # $ V1: chr? "a" "b" "c" "d" ... # $ V2: num? 1 2 10 18 2 # $ V3: num? 6 7 8 9 10 A.K. ________________________________ From: farnoosh sheikhi <farnoosh_81 at yahoo.com> To: "smartpink111 at yahoo.com" <smartpink111 at yahoo.com> Sent: Monday, August 26, 2013 1:48 PM Subject: Loop for converting character columns to Numeric Hi there, I want to change the columns of my data from Character to numeric. Si...
2016 Mar 31
0
Filtering based on the occurrence
Hi Jim,? Thank you tons for your help. The code worked perfectly :)?Best,Farnoosh On Wednesday, March 30, 2016 1:13 AM, Jim Lemon <drjimlemon at gmail.com> wrote: Hi Farnoosh, Despite my deep suspicion that this answer will solve a useless problem, try this: last_subject<-0 keep_deps<-c("B","D","F") keep_rows<-NULL for(ro...
2018 Apr 18
3
Identifying columns with specific character
Hello, I have a data frame with 400 columns and wanted to filter character columns with "$" in it.For example:?>? x <- c("$5", "$89", "$10", "$34")??>? y <- c(1:4)>? My.Data <- data.frame (x,y)> My.Data? ? x y1? $5 12 $89 23 $10 34 $34 4 I want to detect the columns with $ and remove the $ from the selected columns.I have
2018 Apr 18
0
Identifying columns with specific character
Hi Farnoosh, Perhaps this will help: drop_dollar<-function(x) return(as.numeric(as.character(gsub("\\$","",x)))) sapply(My.Data,drop_dollar) Jim On Thu, Apr 19, 2018 at 7:23 AM, Farnoosh Sheikhi via R-help <r-help at r-project.org> wrote: > Hello, > I have a data frame wit...
2017 Jun 30
0
Different date formats in one column
Left as an exercise for the student. -- Sent from my phone. Please excuse my brevity. On June 29, 2017 7:25:36 PM EDT, Farnoosh Sheikhi <farnoosh_81 at yahoo.com> wrote: >Thanks Jeff. This is a nice way of solving this problem. What about the >cases with 0015-02-21?Many thanks.?Best,Farnoosh > > > >On Wednesday, June 28, 2017 10:49 PM, Jeff Newmiller ><jdnewmil at dcn.davis.ca.us> wrote: &g...
2012 Nov 06
1
pivot table
...(200)   Gender (200)    a                           daig1 b                           diag2 c                            diag1 I want to reformat this data to : ID   diag1 diag 2 diag 3..  diagx   proc1   proc2   proc3... procx  DOB  Gender a1011  20F Thanks a lot for your help and time.   Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2012 Nov 12
1
reshape
Hi, I have a R output that looks as follow: Rad:0 Rad1:2 Rad3:3 I want to make a new matrix that looks like : sample size is 2400 Variable    n11  n12 Rad            0     2400-0=2400 Rad1          2       2400-2 Rad3  3      2400-3   Thanks a lot for your time and help:) Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2012 Nov 15
1
Step-wise method for large dimension
...elp. fit0<-lm(Y~1, data= mydata) fit.final<- lm(Y~X1+X2+X3+.....+X400, data=mydata) ??? step(fit0, scope=list(lower=fit0, upper=fit.final), data=mydata, direction="forward") step(fit.final, scope=list(lower=fit.final, upper=fit0), data=mydata, direction="backward")   Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2013 Apr 21
1
Excluding observations
Hi Farnoosh, set.seed(25) Data.All.Var<- data.frame(ID= sample(LETTERS[1:10],25,replace=TRUE), value=rnorm(25),stringsAsFactors=FALSE) set.seed(28) Y.Out<- data.frame(ID=sample(LETTERS[1:5],25,replace=TRUE),value=rnorm(25),stringsAsFactors=FALSE) unique(Y.Out$ID) #[1] "A" "C" "E...
2012 Nov 13
4
for loop
...?????? 2 #2nd method res<-data.frame(colSums(dat1)) ?names(res)<-"sum(n11)" ?res #???? sum(n11) #med1??????? 3 #med2??????? 1 #med3??????? 2 #3rd method ?do.call(rbind,lapply(dat1,sum)) #???? [,1] #med1??? 3 #med2??? 1 #med3??? 2 A.K. ________________________________ From: farnoosh sheikhi <farnoosh_81 at yahoo.com> To: arun <smartpink111 at yahoo.com> Sent: Monday, November 12, 2012 7:24 PM Subject: for loop Hi there, I want to calculate the odds ratio for a data like below. ?I want to compute the sum of each column as a new column and variable names as a new...
2013 Apr 13
2
Comparison of Date format
...})) ?res1<- join(dataNew1,DataB,by=c("Date.Accident","ID"),type="right") ?res1 #? Date.Accident ID Status #1????? 3-Sep-01? 1????? A #2???? 20-Jan-05? 1?? <NA> #3???? 26-Feb-04? 1????? C #4????? 6-Mar-02? 2????? A A.K. ________________________________ From: farnoosh sheikhi <farnoosh_81 at yahoo.com> To: "smartpink111 at yahoo.com" <smartpink111 at yahoo.com> Sent: Friday, April 12, 2013 5:40 PM Subject: Comparison of Date format ?Hi there, Hope all is well. I have a complicated data and I need to create a new variable based on t...