Hi Lara,
Use lapply here instead of sapply or specify simplify = FALSE. See
?sapply for details.
d[, c("fac1", "fac2")] <- lapply(d[, c("fac1", "fac2")], recode,
"c('A', 'B') = 'XX'", as.factor.result = TRUE)
d[, "fac3"] <- recode(d[, "fac3"], "c('A', 'B') = 'XX'")
str(d)
Cheers,
Josh
On Sun,
Hi Nevil,
Here is one option:
## function definition
r2format <- function(object, digits = 3, output, sub, expression = TRUE, ...) {
if (inherits(object, "lm")) {
x <- summary(object)
} else if (inherits(object, "summary.lm")) {
x <- object
} else s
Dear List,
I am using function recode, from package car, within sapply, as follows:
L3 <- LETTERS[1:3]
(d <- data.frame(cbind(x = 1, y = 1:10), fac1 = sample(L3, 10,
replace=TRUE), fac2 = sample(L3, 10, replace=TRUE), fac3 = sample(L3,
10, replace=TRUE)))
str(d)
d[, c("fac1", "fac2")] <- sapply(
I am trying to put an
R2 value with R2 formatted with a superscript 2 followed by "=" and the
value :
the first mtext prints the R2 correctly formatted but follows it with
"=round(summary(mylm)$r.squared,3)))" as text
the second prints "R^2 =" followed by the value of
round(summary(mylm)$r.squ
Hi,
On Sun, Oct 2, 2011 at 4:31 PM, Melhem, Nadine wrote:
> I'm new to learning R. I'm taking a course and will need access to the
> "patients.txt" data to be able to do the exercises required using this
> dataset.
Without more context, I'm doubtful that anybody will be able to help you.
I re
Dear all,
I have spent the last few days on a seemingly simple and previously documented
rolling regression.
I have a 60 year data set organized in a ts matrix.
The matrix has 5 columns; cash_ret, epy1, ism1, spread1, unemp1
I have been able to come up with the following based on previous hel
Duncan Murdoch gmail.com> writes:
>
> On 11-10-02 1:11 PM, Kerry wrote:
> > I have 3 columns of data and want to plot each row as a point in a
> > scatter plot and want one column to be represented as a color gradient
> > (e.g. larger values being more red). Anyone know the command or
> > packa
I'm new to learning R. I'm taking a course and will need access to the
"patients.txt" data to be able to do the exercises required using this dataset.
thanks.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do re
please send me the "patients.txt" data.
thanks.
__
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 commented, minimal, self-containe
Yes, perfect! This I can work with.
Thanks,
KB
On Oct 2, 3:55 pm, Duncan Murdoch wrote:
> On 11-10-02 1:11 PM, Kerry wrote:
>
> > I have 3 columns of data and want to plot each row as a point in a
> > scatter plot and want one column to be represented as a color gradient
> > (e.g. larger values
Hi, all,
I am a newbie for [R]
Would anyone help me how to transpose a 3x3x3 array for 1:27
Eg.
A<-array(1:27, c(3,3,3)
What is the logic to transpose it to B<-aperm(A, c(3,2,1))
Because I found I could not imagine how it transposes, anyone could solve my
problem?
And most important I could get
> Dear all,
> I am confused with the output of survfit.coxph.
> Someone said that the survival given by summary(survfit.coxph) is the
> baseline survival S_0, but some said that is the survival
> S=S_0^exp{beta*x}.
>
> Which one is correct?
The ³baseline survival², which is the survival for a hyp
Basically, createDataPartition is used when you need to make one or
more simple two-way splits of your data. For example, if you want to
make a training and test set and keep your classes balanced, this is
what you could use. It can also make multiple splits of this kind (or
leave-group-out CV aka
On Sun, Oct 2, 2011 at 10:05 AM, Erik Svensson
wrote:
> Hello,
> In a data frame I want to identify ALL duplicate IDs in the example to be
> able to examine "OS" and "time".
>
> (df<-data.frame(ID=c("userA", "userB", "userA", "userC"),
> OS=c("Win","OSX","Win", "Win64"),
> time=c("12:22","23:22"
Here is a function I use to find all duplicate records
> allDup <- function (value)
{
duplicated(value) | duplicated(value, fromLast = TRUE)
}
> x
IDOS time
1 userA Win 12:22
2 userB OSX 23:22
3 userA Win 04:44
4 userC Win64 12:28
> x[allDup(x$ID),]
ID OS time
1 userA Wi
Em 1/10/2011 13:24, spicymchaggis101 escreveu:
Thank you very much! your response solved my issue.
I needed to determine the probability of normality for word types per page.
You need to insure this assumption is reasonable for your problem domain
as words types per page seems like count data
Hi,
On Sun, Oct 2, 2011 at 3:54 PM, wrote:
> Hi Steve,
>
> Thanks for the note. I did try the example and the result didn't make sense
> to me. For splitting a vector, what you describe is a big difference btw
> them. For splitting a dataframe, I now wonder if these 2 functions are the
> wrong c
Hi Erin,
The last I checked - it was not possible.
However, the place to ask this is here:
http://support.rstudio.org/help/discussions
Contact
Details:---
Contact me: tal.gal...@gmail.com | 972-52-7275845
Read me: www.talgalili.
On 11-10-02 1:11 PM, Kerry wrote:
I have 3 columns of data and want to plot each row as a point in a
scatter plot and want one column to be represented as a color gradient
(e.g. larger values being more red). Anyone know the command or
package for this?
It's not a particularly effective displa
Hi Steve,
Thanks for the note. I did try the example and the result didn't make
sense to me. For splitting a vector, what you describe is a big
difference btw them. For splitting a dataframe, I now wonder if these
2 functions are the wrong choices. They seem to split the columns, at
least
Here is one:
http://cran.r-project.org/web/packages/scatterplot3d/index.html
In the future, consider first searching:
http://finzi.psych.upenn.edu/search.html
http://rseek.org/
etc...
Contact
Details:---
Contact me: tal.gal...
Dear all,
I would like to thank you for you answers
This worked for me
Browse[1]> match(Test,seq(1,C,FrN),nomatch=FALSE)
[1] 1 0 2 3 0 0 4 0 0 5 0 0 6 7 0 0 8 0
[19] 0 9 0 10 11 0 0 12 0 0 13 14 0 15 0 16 0 0
[37] 17 18 19 0
I have 3 columns of data and want to plot each row as a point in a
scatter plot and want one column to be represented as a color gradient
(e.g. larger values being more red). Anyone know the command or
package for this?
Thanks,
KB
__
R-help@r-project.o
Hi,
On Sun, Oct 2, 2011 at 2:47 PM, wrote:
> Hello,
>
> I'm trying to separate my dataset into 4 parts with the 4th one as the test
> dataset, and the other three to fit a model.
>
> I've been searching for the difference between these 2 functions in Caret
> package, but the most I can get is th
On Sat, Oct 1, 2011 at 4:59 AM, Farley, Robert wrote:
> I'm about to add weights to a bus on-board survey dataset with ~150 variables
> and ~28,000 records. My intention is to weight (for each bus "run") by
> boarding stop and alighting stop. I've seen the Rake function of the Survey
> packag
On Sat, Oct 1, 2011 at 2:31 PM, koshihaku wrote:
> Dear all,
> I am confused with the output of survfit.coxph.
> Someone said that the survival given by summary(survfit.coxph) is the
> baseline survival S_0, but some said that is the survival S=S_0^exp{beta*x}.
>
> Which one is correct?
The basel
Hello,
I'm trying to separate my dataset into 4 parts with the 4th one as the
test dataset, and the other three to fit a model.
I've been searching for the difference between these 2 functions in
Caret package, but the most I can get is this--
A series of test/training partitions are crea
Erik Svensson wrote:
>
> Hello,
> In a data frame I want to identify ALL duplicate IDs in the example to be
> able to examine "OS" and "time".
>
> (df<-data.frame(ID=c("userA", "userB", "userA", "userC"),
> OS=c("Win","OSX","Win", "Win64"),
> time=c("12:22","23:22","04:44","12:28")))
>
>
Hi Jay,
I see this thread is a bit (ok, quite) old at this point, but I see
you never really got an answer to your question that was satisfactory.
I figured you might be interested to know that Dirk has started to
wrap vowpal wabbit[1,2] into an R package, RVowpalWabbit[3,4]
The package itself is
Hello Jay,
Did you find the answer to your question on incremental machine
learning? If not, I found some links that might help:
It appears that might be able to do streaming/incremental machine
learning in Weka:
http://moa.cs.waikato.ac.nz/details/classification/using-weka/
On the above li
On 2011-10-01 09:24, spicymchaggis101 wrote:
Thank you very much! your response solved my issue.
I needed to determine the probability of normality for word types per page.
You may want to review just what the test does. It certainly does not
give you the 'probability of normality'. A worthwh
Dear All,
I am learning R and Time Series Econometrics for the first time. I have
doubt regarding cointegration specification criteria. The problem follows:
test1 <- ca.jo(data1,ecdet="const",type="trace",K=2,spec="transitory")---When
to specify transitory
test1 <- ca.jo(data1,ecdet="const",type=
Dear r-helpers,
Here I would like to have your kind helps on generating Venn diagram.
There are some packages within R on this task, like venneuler, VennDiagram,
vennerable. But, vennerable can not be installed on my Mac book. It seems
VennDiagram can not work on my data. And, venneuler may have
Hi,
You really need to study the documentation of "optim" carefully before you make
broad generalizations. There are several algorithms available in optim. The
default is a simplex-type algorithm called Nelder-Mead. I think this is an
unfortunate choice as the default algorithm. Nelder-Mea
On 02.10.2011 16:05, Erik Svensson wrote:
Hello,
In a data frame I want to identify ALL duplicate IDs in the example to be
able to examine "OS" and "time".
(df<-data.frame(ID=c("userA", "userB", "userA", "userC"),
OS=c("Win","OSX","Win", "Win64"),
time=c("12:22","23:22","04:44","12:28"))
Hello,
In a data frame I want to identify ALL duplicate IDs in the example to be
able to examine "OS" and "time".
(df<-data.frame(ID=c("userA", "userB", "userA", "userC"),
OS=c("Win","OSX","Win", "Win64"),
time=c("12:22","23:22","04:44","12:28")))
IDOS time
1 userA Win 12:22
2 use
Dear list members,
I am a (very) recent convert to R and I am hoping you can help me with a
problem I'm having. I'm trying to fit a first-order transfer function to an
ARIMA intervention analysis using the "arimax" function. The data was
obtained from McCleary & Hay (1980) (via Rob Hyndman's Time
Thanks Gabor, that was exactly what I needed.
On Sep 30, 9:00 pm, Gabor Grothendieck
wrote:
> On Fri, Sep 30, 2011 at 3:01 AM, Kang Min wrote:
> > Hi all,
>
> > I was wondering if there's an equivalent to par(new=T) of the plot
> > function in lattice. I'm plotting an xyplot, and I would like to
Sarah,
Sorry for being ignorant. I was doing something wrong. It works perfectly.
Thank you.
Cecília Carmo
-Mensagem original-
De: Sarah Goslee [mailto:sarah.gos...@gmail.com]
Enviada: domingo, 2 de Outubro de 2011 14:21
Para: Cecilia Carmo
Cc: r-help@r-project.org
Assunto: Re: [R] s
Hi,
On Sun, Oct 2, 2011 at 9:08 AM, Cecilia Carmo wrote:
> Thank you very much.
>
> My dataframe has thousands of firms, how can I delete all of those with x<0
> and keep another dataframe with firms where all x>0?
How does that differ from your original question? What doesn't work for you in
th
Thank you very much.
My dataframe has thousands of firms, how can I delete all of those with x<0
and keep another dataframe with firms where all x>0?
Thank you again.
Cecília Carmo
(Universidade de Aveiro - Portugal)
-Mensagem original-
De: Sarah Goslee [mailto:sarah.gos...@gmail.com]
On Sat, 1 Oct 2011, Nitin Bhardwaj wrote:
Hi,
I want to fit 3 beta distributions to my data which ranges between 0 and 1.
What are the functions that I can easily call and specify that 3 beta
distributions should be fitted?
I have already looked at normalmixEM and fitdistr but they dont seem to
As I think it is not spam but helpful, let me repeat my stats.stackexchange.com
question here, from
http://stats.stackexchange.com/questions/16346/difference-between-lp-or-simply-in-rs-locfit
I am not sure I see the difference between different examples for local
logistic regression in the docu
Hi,
On Sun, Oct 2, 2011 at 7:48 AM, Cecilia Carmo wrote:
> I need help in subseting a dataframe:
>
>
>
> data1<-data.frame(year=c(2001,2002,2003,2004,2001,2002,2003,2004,
>
> 2001,2002,2003,2004,2001,2002,2003,2004),
>
> firm=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),x=c(11,22,-32,25,-26,47,85,98,
>
> 1
I need help in subseting a dataframe:
data1<-data.frame(year=c(2001,2002,2003,2004,2001,2002,2003,2004,
2001,2002,2003,2004,2001,2002,2003,2004),
firm=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),x=c(11,22,-32,25,-26,47,85,98,
101,14,87,56,12,43,67,54),
y=c(110,220,302,250,260,470,850,980,1010,140,87
2011/10/2 Oscar Ramírez :
> It is possible to install R on Ipad 2?
>
This discussion predates the iPad 2, but the licensing restrictions likely
still apply:
http://www.r-statistics.com/2010/06/could-we-run-a-statistical-analysis-on-iphoneipad-using-r/
One-word answer: no.
Two-word answer: Not lega
ahh, perfect, thanks.
Cheers,
Marius
On 2011-10-02, at 13:08 , Jim Lemon wrote:
> On 10/02/2011 07:20 PM, Hofert Jan Marius wrote:
>> Dear all,
>>
>> this should be trivial, but I couldn't figure out how to solve it... I would
>> like to have a plot with fixed aspect ratio of 1. Whenever I re
On 10/02/2011 07:20 PM, Hofert Jan Marius wrote:
Dear all,
this should be trivial, but I couldn't figure out how to solve it... I would like to have
a plot with fixed aspect ratio of 1. Whenever I resize the Quartz window, the axes are
extended so that the plot fills the whole window. However,
It is possible to install R on Ipad 2?
--
Oscar Ramírez A.
Universidad Nacional, Escuela de Ciencias Biológicas.
M.Sc. en Conservación y Manejo de Vida Silvestre
osorami...@gmail.com
[[alternative HTML version deleted]]
__
R-help@r-p
And there I caught myself with the next blooper: it wasn't Ben Bolker, it was
Bert Gunter who pointed that out. :)
Daniel Malter wrote:
>
> Ben Bolker sent me a private email rightfully correcting me that was
> factually wrong when I wrote that ML /is/ a numerical method (I had
> written sloppil
Ben Bolker sent me a private email rightfully correcting me that was
factually wrong when I wrote that ML /is/ a numerical method (I had written
sloppily and under time pressure). He is of course right to point out that
not all maximum likelihood estimators require numerical methods to solve.
Furth
Dear all,
this should be trivial, but I couldn't figure out how to solve it... I would
like to have a plot with fixed aspect ratio of 1. Whenever I resize the Quartz
window, the axes are extended so that the plot fills the whole window. However,
if you have different extensions for the differen
52 matches
Mail list logo