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 t
Hi,
I have the below function which returns confidence intervals. I wanted to pass
different sample sizes through the function, but for some reason it's not
working. n <- seq(from=40, to=300, by=2o)
I was also wondering how I can return a plot for different sample sizes.
plot(m~d, main="
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
wrote:
I doubt your actual file looks like the mess that made it to my email
software (below) because you
Hi Christoph,
There is "," between dates.Many thanks. Best,Farnoosh
On Wednesday, June 28, 2017 9:05 PM, Christoph Puschmann
wrote:
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-h
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
011-01-03" ,"2011-01-04",
"2011-01-05", "2011-01-06" ,"2011-01-07", "2011-01-07", "2011-01-09"
,"2011-01-10" ,"2011-01-11" ,"2011-01-11")deps<-c("A", "B&quo
lt;-
data.frame(Subject, dates, deps)df
The final data set should look like this:newdate<-c(" 2011-01-03",
"2011-01-03", "2011-01-03", "2011-01-05", "2011-01-05", "2011-01-05" ,
"2011-01-08", "2011-01-08", "201
;C", "CC", "A", "F", "DD", "A", "F", "FF", "D")df <-
data.frame(Subject, dates, deps)df
The final data set should look like this:newdate<-c(" 2011-01-03",
"2011-01-0
Hi all,
I have two data sets similar like below and wanted to merge them with variable
"deps". As this is a sample data with small sample size, I don't have any
problem using command merge. However, the actual data set has ~60,000
observations with a lot of repeated measures. For example, for a
Hi Jim,
Thank you tons for your help. The code worked perfectly :) Best,Farnoosh
On Wednesday, March 30, 2016 1:13 AM, Jim Lemon
wrote:
Hi Farnoosh,
Despite my deep suspicion that this answer will solve a useless
problem, try this:
last_subject<-0
keep_deps<-c(&quo
te('2011-01-12'),by = 1) deps<-c("A",
"B", "C", "C", "D", "A", "F", "G", "A", "F", "A", "D")df <- data.frame(Subject,
dates, deps)df
The final da
Hello,
I'm trying to get the distances between two Zipcode variables, but for some
reason I get this error:
"matching was not perfect, returning what was found.Error: no such index at
level 1"
Here is my code:
library(ggmap)mapdist(data$Zip.A, data$Zip.B, mode = "driving")
The Zip codes are all
last entries.
I change my assessment : this looks bad. (Tea at hand).
So, presumably Farnoosh may not be able to guarantee the formats for 3 & 4
either unless they are unambiguously dated.
John Kane
Kingston ON Canada
> -Original Message-
> From: sarah.gos...@gmail.com
-7L),
class = "data.frame")SampleData
Thanks for your help:).
On Wednesday, July 29, 2015 1:50 PM, Sarah Goslee
wrote:
On Wed, Jul 29, 2015 at 2:45 PM, farnoosh sheikhi v
Hi Arun,
Hope all is well with you. I have a data with a column for date.The date format
is mixed. There are date values with Month/Day/Year format and values with
Day/Month/Year format.I don't know how to unify it.I really appreciate your
help.Thanks.
[[alternative HTML version dele
That's exactly what I was thinking. Thanks tons.
Sent from Yahoo Mail on Android
From:"arun"
Date:Sun, Feb 15, 2015 at 2:47 AM
Subject:Re: Difference in dates for unique ID
HI Farnoosh,
Not sure I understand the expected output.� The difference between the first 2
days is
Thank you all. That was very helpful. Farnoosh
On Saturday, December 6, 2014 7:41 PM, Chel Hee Lee
wrote:
It seems that you would like to make a spaghetti plot (in a longitudinal
data analysis). You can use the function 'interaction.plot()'.
> with(my.df, int
It actually worked perfectly.
Thank you so much. I always learn a lot from you:).
Farnoosh
On Monday, July 7, 2014 6:51 PM, arun wrote:
Not sure this helps as you provided only very little info.
library(stringr)
str1 <- c("TE MA CRUZ ABEL","JOSE AN ANDRA&
You are the best. Thanks tons:))
Regards, Farnoosh Sheikhi
On Thursday, February 27, 2014 10:37 PM, arun wrote:
Hi Farnoosh,
YOu can try:
DataA$percent <- with(DataA,round((Var2/sum(Var2))*100,2))
library(ggplot2)
ggplot(DataA,aes(x=Var1,y=percent))+geom_bar(stat="identity&q
, etc.
I want to create a data set in R based on this story.
I really appreciate any help and direction.
Regards, Farnoosh Sheikhi
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
Thank you so much Arun:)
On Wednesday, February 19, 2014 6:06 PM, arun wrote:
Hi Farnoosh,
Try:
library(plyr)
res <- join(`DATA-A`,`DATA-B`,by="Var1",type="right")[,c(3,1:2,4)]
head(res)
# ID Var1 Var2 var3
#1 1 AETNA CARDINAL CA
Perfect. Thank you so much.
Regards, Farnoosh Sheikhi
On Thursday, February 13, 2014 2:16 PM, arun wrote:
Hi Farnoosh,
If I understand it correctly,
dat <-read.table(text="Var1
Great>5
great
'less great<2'
'approx great11'",sep="",head
Thanks:)
Regards, Farnoosh Sheikhi
On Thursday, February 13, 2014 1:29 PM, arun wrote:
Sorry, the library should be
library(reshape2)
On Thursday, February 13, 2014 4:27 PM, arun wrote:
HI Farnoosh,
You can use ?dcast()
library(plyr)
dcast(DataA,ID~Var1,value.var="Var2&qu
Thanks a lot. That worked perfectly.
Best,Farnoosh Sheikhi
Sent: Wednesday, August 28, 2013 10:37 AM
Subject: Re: list to data frame
If the expected result is data.frame()
as.data.frame(t(as.data.frame(lapply(dat1,sum# would be data.frame. But,
not
Thanks a lot. That works great.
I have another question, I will send you another email.
Best,Farnoosh Sheikhi
Cc: R help
Sent: Monday, August 26, 2013 12:06 PM
Subject: Re: Loop for converting character columns to Numeric
Hi,
Suppose you created a
Thanks for the code. It was so simple and worked perfectly.
I really appreciate it.
Best,Farnoosh Sheikhi
Cc: R help
Sent: Wednesday, August 14, 2013 11:56 AM
Subject: Re: changing colnames
Hi,
You could try:
dat1<- read.table(text="
X1,X2,X3
Thanks a lot Arun.
I like the do.call command a lot. So easy to use and fast:-)
Best,Farnoosh Sheikhi
Cc: R help
Sent: Monday, July 29, 2013 1:58 PM
Subject: Re: Aggregate
Hi,
You could try:
dat1<- read.table(text="
ID Group1
1 1
1
te x2 x1 x3
56 25-Jun-01 10 2 126
56 29-Oct-01 10 2 140
56 18-Mar-02 10 2 445
56 6-Jun-03 10 2 224
56 16-Jan-04 NA NA
58 10-Jan-02 10.8 1 715
58 26-Dec-03 10.8 1 NA
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
Hi,
I want to simulate from Markov Chain Discrete Algorithm and my transition
matrix is:
The probability transition matrix
trans = matrix(c(0.8,0.05,0.05,0,
0.05,0.80,0.055,
0.05,0.05,0.81, 0, 0.05, 0.095, 0, 0.81), ncol=4, byrow=TRUE);
The Initiate Values are
Thanks a lot.
That worked:-)
Cc: R help
Sent: Sunday, April 21, 2013 7:32 AM
Subject: Re: Excluding observations
Hi Farnoosh,
set.seed(25)
Data.All.Var<- data.frame(ID= sample(LETTERS[1:10],25,replace=TRUE),
value=rnorm(25),stringsAsFactors=FA
Thanks a lot:)
Sent from my iPad
On Apr 16, 2013, at 10:15 PM, arun wrote:
> Hi Farnoosh,
> YOu can use either ?merge() or ?join()
> DataA<- read.table(text="
> ID v1
> 1 10
> 2 1
> 3 22
> 4 15
> 5 3
> 6 6
> 7
New[3,] &
x2[i,2]< x1New[4,] ,]; x4<-x2[i,][nrow(x3)>0];merge(x3[,1:2],x4) }))}))
dataNew2$Date.Accident<-format(dataNew2$Date.Accident,"%d-%b-%y")
library(plyr)
res<-join(rbind(dataNew1,dataNew2),DataB,by=c("ID","Date.Accident"),type="rig
00 1
Thanks.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide
!!!
I'm wondering if there is something wrong in my codes .
Thanks a lot and happy holidays!
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
P
olumn my lab or procedures
start.
I really appreciate your help.
Thanks.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
Thank you so much.
It worked very well:)
Best,Farnoosh Sheikhi
Cc: R help
Sent: Wednesday, December 12, 2012 12:59 PM
Subject: Re: Subset of Data
Hi Farnoosh,
Try this:
set.seed(151)
mat1<-matrix(sample(1:400,100,replace=TRUE),ncol=20)
set.seed
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]]
___
thanks dear. method 2 worked very fast since my data is very big.
Thanks a lot. :-)
Best,Farnoosh Sheikhi
Cc: R help
Sent: Monday, November 12, 2012 6:15 PM
Subject: Re: for loop
HI,
You can do this in many ways:
dat1<-read.table(text="
med1,m
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
I'm using Revolution R Enterprise.
This command worked perfectly.
Thank you so much for your help and time:-)
Best,Farnoosh Sheikhi
Cc: R help
Sent: Wednesday, November 7, 2012 10:47 AM
Subject: Re: [R] pivot table
HI,
Could you tell me which version
Hi there,
Thanks forhelping. I really appreciate it.
The only thing is I get this error: "Error in gsub("[\\_]", ".", paste0("Lab",
colnames(res2)[-1])) :
could not find function "paste0""
Thanks.
Best,Farnoosh Sheikhi
___
It worked beautifully.
Thank you so much:-)
Best,Farnoosh Sheikhi
Cc: R help
Sent: Tuesday, November 6, 2012 2:44 PM
Subject: Re: [R] pivot table
Hi,
Is this okay?
library(reshape2)
dat1<-read.table(text="
ID Diag Proc DOB Gender
a
Hi there,
Thanks a lot for your help, but Proc doesn't show in the result.
I also want to assign 1 and 0 instead of the name of variables.
Thanks a lot.
Best,Farnoosh Sheikhi
Cc: R help
Sent: Tuesday, November 6, 2012 1:42 PM
Subject: Re: [R] pivot
Lab3.A
a 11 1000
b 0 1001 0
Thanks a lot:)
Best,Farnoosh Sheikhi
Cc: R help
Sent: Tuesday, November 6, 2012 2:44 PM
Subject: Re: [R] pivot table
Hi,
Is this okay?
library(reshape2)
dat1<-read.table(text="
ID Dia
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]]
__
R-help@r
Thanks a lot. Is count command in package COUNT? I'm having a hard fine to fine
this package.
Thanks again:)
Best,Farnoosh Sheikhi
Cc: R help
Sent: Tuesday, October 23, 2012 2:07 PM
Subject: Re: [R] frequency
Hi,
Try this:
dat1<-read.table(t
hanks a lot.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide comm
form.
When I put odds.ratio=as.matrix(odds.ratio), my plot shows the numbers.
I really appreciate your help.
Thanks.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listi
Hi,
I have a column of DOB in mm/dd/. I want to convert this format to age.
Thanks a lot.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
50 100 0.9647998
>
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
an
50 matches
Mail list logo