Hello R users,
I have 2 files (file1 and f2) and I am trying to sum columns 6:10 of a
specific row in f2 and append it in
file 1 if the state variable in file 1 equals the rowname in f2. Below is
an example of the code I wrote
using a for loop, but it not working (i.e it only works for the
Hi David - thanks for your suggestion, but I am trying to avoid doing any
merging and sorting for this step because the real file I will be working
with has about 20 million records. If I can get this loop or something
similar to work will be good enough.
thanks again..
--
View this message
Hi Sayan,
This is exactly what I was looking for - it worked perfectly.
Many thanks!!
Also, thanks to everyone else for their suggestions.
Pele
--
View this message in context:
http://r.789695.n4.nabble.com/For-loop-with-ifelse-help-tp2550547p2552388.html
Sent from the R help mailing list
Hi R users,
I am trying to compare 2 data frames by subject and match and save the no
matches to an object called nomatch, but I am getting unexpected results...
Can anyone tell me how to correct the code to get the expected results shown
in the last table?
Many thanks in advance for your any
- c(1:11)
df2$match - 1
df2$key - paste(df2$subject, df2$match, sep=) ; df2
nomatch - subset(df2, is.element(df2[,key], df1[,key])==FALSE); nomatch
rm(list=ls())
Pele wrote:
Hi R users,
I am trying to compare 2 data frames by subject and match and save the no
matches to an object
Hi R users,
I have a time series variable that is only available at a monthly level for
1 years that I need to decompose to a weekly time series level - can
anyone recommend a R function that I can use to decompose this series?
eg. if month1 = 1200 I would to decompose so that the sum of the
Hello R users,
I am new to R and am wondering if anyone can help me out
with the following issue: I wrote a function to build ts models using
different inputs, but when R displays the call for a model, I cannot tell
which variables
it is using because it shows the arguments instead of the real
Hello R users,
I have been trying to output all my results (text, plots, etc) into the same
postscript file as
one document, but have been unable to...Can anyone help me improve my
simplified version of the code below so that I can accomplish this?
Currently I have to output them separately
Hello R users,
I have been trying to output all my results (text, plots, etc) into the same
postscript file as
one document, but have been unable to...Can anyone help me improve my code
below so that I can
accomplish this? Currently I have to output them separately then piece them
back
Hello R users,
Below is the code and output of what I am trying to do. My goal is to
insert/print all items in the chart function into a pdf document. Only the
acf and pacf charts gets printed.
Again, thanks in advance for any help I can get!
options
Hello R users,
Can someone tell if there is a package in R that can do outlier detection
that give outputs simiilar to what I got from SAS below.
Many thanks in advance for any help!
Outlier Details
, Level Shifts, or
Temporary Changes... The output in the original not is what SAS produces and
I was looking for something similar.. R is very new to me (4 weeks) hence
still feeling my way around...
Many thanks!
Pele wrote:
Hello R users,
Can someone tell if there is a package in R that can
Hi Hans - I tried your suggestion and it worked out well... Many thanks!!
Also, thank to everyone else for their suggestions.
Hans W. Borchers-4 wrote:
Pele drdionc at yahoo.com writes:
Hello R users,
Can someone tell if there is a package in R that can do outlier detection
Hi R users,
I am doing cross correlation analysis on 2 time series (call them y-series
and x-series) where I need the use the model developed on the x-series to
prewhiten the yseries.. Can someone point me to a function/filter in R that
would allow me to do that?
Thanks in advance for any
Hi Bob - your suggesting worked out great... Many thanks!
Also, thanks everyone for the other suggestions!
Bob McCall wrote:
Look in the package forecast for the function Arima. It will do what
you want. It's different than arima function in the stats package.
Bob
Pele wrote:
Hi R
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
Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org] On Behalf Of Pele
Sent: Monday, February 23, 2009 1:59 PM
To: r-help@r-project.org
Subject: [R] Formula that includes
Hi R users,
I have a data frame that contains 10K obs and 200 variables
where I am trying to format the numeric columns to look
like the output table below (format to 2 decimal places) but I am
having no luck.. Can someone tell me the best way to
accomplist this?
Thanks in advance for any
x1 x2x3
1 a1 0.01 0.00 12.33
2 b3 0.48 0.00 9.44
3 c1 0.48 0.00 9.44
4 d5 0.48 0.00 9.44
5 e1 0.48 0.00 9.44
6 f2 0.48 0.00 9.44
7 g6 0.33 0.00 9.44
8 h8 0.33 0.00 9.44
9 i2 0.33 0.00 9.44
10 k2 0.33 0.00 9.44
On Wed, Feb 25, 2009 at 4:19 PM, Pele drdi
, Pele drdi...@yahoo.com wrote:
Hi R users,
I have an R object with the following attributes:
str(sales.bykey1)
'by' int [1:3, 1:2, 1:52] 268 79 118 359 87 147 453 130 81 483 ...
- attr(*, dimnames)=List of 3
..$ GROUP: chr [1:3] III II I
..$ year : chr [1:2] 2006 2007
Hi R users,
I have a factor variable called date as shown below: Can anyone share the
best / most efficient way to extract year and week (e.g. year = 2006, week
= 52 for first record, etc..)? My data set has 1 million records.
DATE
11DEC2006
11SEP2006
01APR2007
02DEC2007
Thanks in
Hi Uwe,
You are correct - that was a type O (52) and thanks for you your suggestion
that works..
Pele wrote:
Hi R users,
I have a factor variable called date as shown below: Can anyone share the
best / most efficient way to extract year and week (e.g. year = 2006,
week = 52
Hi R users,
I am looking for a date function that will give the following:
- The number-of-week value is in the range 01-53
- Weeks begin on a Monday and week 1 of the year is the week that
includes both January 4th and the first Thursday of the year.
If the
to numeric if desired:
nweek.dBY - function(x) as.integer(format(strptime(x, %d%B%Y) ,
%W))
nweek.dBY(dt)
[1] 1
--
David Winsemius
On Mar 7, 2009, at 12:34 PM, Pele wrote:
Hi R users,
I am looking for a date function that will give the following:
- The number-of-week value
Hi R users,
Can anyone share some example code using merge_all (from the reshape
package) to merge 10 data frames into 1 file.
Thanks in advance for any help!
--
View this message in context:
of this function, thanks. Similar solutions using base
functions were proposed recently on
http://wiki.r-project.org/rwiki/doku.php?id=tips:data-frames:merge
and i've now added this for reference.
baptiste
On 8 Mar 2009, at 20:23, Pele wrote:
Hi R users,
Can anyone share some
2 0.183317 31 2.50352 11
HTH,
baptiste
On 8 Mar 2009, at 23:40, Pele wrote:
I tried using merge_all as shown below but I am getting an error ...
can
anyone tell me what I am doing wrong? The result table below is
what I am
looking for.
DF1 - data.frame(var1 = letters[1:5
Hello,
i am a newby on R and i am trying to make a backward selection on a
binomial-logit glm on a large dataset (69000 lines for 145 predictors).
After 3 days working, the stepAIC function did not terminate. I do not
know if that is normal but i would like to try computing a "homemade"
ter_Sequoia)
--> The predictors between quotes (excepted y) are qualitative ; others
are groups of continuous predictors
Var_model<-paste0("y ~ ", paste(champ_model_cont[-1],collapse=" + "))
Logit_appr<-glm(formula=Var_model,family=binomial(link="logit"),data=
29 matches
Mail list logo