Hi,
A colleague invited me to teach a short course in R for Management,
Accounting, and Economics PhD students. I would have 5 3-hour classes. Any
ideas (datasets, syllabus, teaching strategies, etc.) are welcome.
Kind regards,
Iuri.
_
Dr. Iuri
Dear David,
Thanks for your reply.
I'll try to be more specific: why
library(survival)
data(ovarian)
fit - coxph(Surv(futime, fustat) ~ resid.ds *rx + ecog.ps, data = ovarian,
subset=ovarian$age50)
anova(fit)
fit2 - coxph(Surv(futime, fustat) ~ resid.ds +rx + ecog.ps, data=ovarian,
From the help on getOption():
pkgType:
The default type of packages to be downloaded and installed – see
install.packages. Possible values are source (the default except under
the CRAN OS X build) and mac.binary.. Windows uses win.binary.
(mac.binary.leopard and mac.binary.universal are no
Hi
I am extensively using R to process large amount of data. I tried to source my
scripts to run sequentially in R, instead of running them seperately. However,
I always receive an error message related to the memory size although I
upgraded my RAM from 8GB to 16GB. i do not think this is the
Dear community,
I have the following problem: I have a multilevel model with two level 1
nominal predictors. My level one predictors are experimental condition nested
in persons. I used the R-package lme4
my data file looks like that:
(DV = dependent variable, IV = independent variable)
For the last case with the list:
x - 1:2; y = list(x)[rep(1, 4)]
.Internal(inspect(y))
@102bbe090 19 VECSXP g0c3 [MARK,NAM(2)] (len=4, tl=0)
@106119628 13 INTSXP g0c1 [MARK] (len=2, tl=0) 1,2
@106119628 13 INTSXP g0c1 [MARK] (len=2, tl=0) 1,2
@106119628 13 INTSXP g0c1 [MARK] (len=2, tl=0)
On Wed, Jan 29, 2014 at 9:26 AM, Ahmed M. El-Kenawy ken...@mans.edu.eg wrote:
Error in memory.size(min = TRUE) : unused argument (min = TRUE)
It looks like you've simply typed 'min=TRUE' instead of 'max=TRUE'
somewhere! Somewhere other than the code you sent in the message,
which had max=TRUE.
On 29-01-2014, at 00:52, ce zadi...@excite.com wrote:
Sorry how do access this menu? R-studio? I open an xterm and type R to start
R.
sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: i386-apple-darwin9.8.0 (32-bit)
locale:
[1] C
attached base packages:
[1] stats
Dear David, and R-users,
thanks for the response. I'll do my best to describe the context.
My data consists in two matrices, D and T. The former provides simple
values, the latter is a Boolean matrix. The number of rows in D is equal
to the number of columns in T.
My aim is to construct a
Hi
for plotting augPred objects lattice graphic is used so you can go through help
pages e.g for xyplot.
Here are some hints
http://r.789695.n4.nabble.com/Display-Multiple-page-lattice-plots-td826957.html
http://r.789695.n4.nabble.com/R-lattice-layout-multiple-pages-td812862.html
you could try
Hi. I saw this example and I cannot begin to figure out how it works. Can
anyone give me an idea on this?
n = 9e6
df = data.frame(values = rnorm(n),
ID = rep(LETTERS[1:3], each = n/3),
stringsAsFactors = FALSE)
head(df)
values ID
1 -0.7355823 A
2 -0.4729925
On 14-01-28 11:43 PM, andrewH wrote: Hi Folks!
I have been writing a small set of utilities for dealing with files
that are
hard to open correctly for one reason or another, especially because they
are too big for memory, non-rectangular, or contain odd characters or
unexpected codings, or
Hi
everything is written in docs. However this example is a little tricky.
Each df$ID matches name of item in translator_vector and [] selects this
matched item.
It is similar like
x-sample(1:3, 10,replace=T)
translator_vector[x]
Regards
Petr
-Original Message-
From:
On 14-01-29 6:41 AM, Bill wrote:
Hi. I saw this example and I cannot begin to figure out how it works. Can
anyone give me an idea on this?
n = 9e6
df = data.frame(values = rnorm(n),
ID = rep(LETTERS[1:3], each = n/3),
stringsAsFactors = FALSE)
head(df)
Folks,
I got the following prices by scraping a web page just for my own edification:
thePrices-
c(id=\p0\$69.95/div, id=\p1\$44.95/div, id=\p2\$69.95/div,
id=\p3\$59.95/div, id=\p4\$69.95/div, id=\p5\$79.95/div,
id=\p6\$89.95/div, id=\p7\$59.95/div, id=\p8\$59.95/div,
id=\p9\$79.95/div,
--- begin included message ---
But If I do
fit - coxph(Surv(futime, fustat) ~ resid.ds *rx + ecog.ps, data = ovarian,
subset=ovarian$age50)
anova(fit)
fit2 - coxph(Surv(futime, fustat) ~ resid.ds +rx + ecog.ps, data=ovarian,
subset=ovarian$age50)
anova(fit2,fit)
The first p-value
Dear Dr. Therneau,
Thanks a lot for your answer. I use your survival package often and I find it
very useful.
Cheers,
Oscar
Oscar M. Rueda, PhD.
Postdoctoral Research Fellow, Caldas Lab, Breast Cancer Functional
Genomics.
University of Cambridge. Cancer Research UK Cambridge Institute.
Li
I am not sure if below ways are better.
sub(.*(.*).*,\\1,thePrices)
sapply(thePrices, function(x){s=gregexpr(pattern
='\\$',x)[[1]][1];e=gregexpr(pattern
='',x)[[1]][1];return(substr(x,s,e-1))})
On Wed, Jan 29, 2014 at 9:29 AM, Keith S Weintraub kw1...@gmail.com wrote:
Folks,
I got the
Actually, it's worse than you think.
Ideal: if the survival curve has a horizontal segment at exactly 50%, report the midpoint
of that segment.
For uncensored data, this makes the routine agree with the ordinary definition
of a median.
Reality: The survfit routine tries for this. However,
Hi
Slight modification to get rid of $
as.numeric(gsub(.*\\$(.*).*,\\1,thePrices))
Petr
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of dan wang
Sent: Wednesday, January 29, 2014 3:55 PM
To: Keith S Weintraub
Cc:
Dear all,
I am trying to estimate a multinomial logit model with mlogit.
The data I use for the estimation have the following format (in the full data
set, there are many more explanatory variables, but I omit them here for the
sake of simplicity):
head(sample)
choice cl_vint_com
Advice: I would guess that you are overfitting. Simplify your model.
Drop some of the variables.You probably have (near) linear
dependencies in your design matrix.
-- Cheers,
Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
Data is not information. Information is not
Here is another approach:
thePrices-
+ c(id=\p0\$69.95/div, id=\p1\$44.95/div,
id=\p2\$69.95/div,
+ id=\p3\$59.95/div, id=\p4\$69.95/div,
id=\p5\$79.95/div,
+ id=\p6\$89.95/div, id=\p7\$59.95/div,
id=\p8\$59.95/div,
+ id=\p9\$79.95/div, id=\p10\$79.95/div,
You could use ?gsub() or
library(qdap)
as.numeric(unlist(genXtract(thePrices,$,)))
# [1] 69.95 44.95 69.95 59.95 69.95 79.95 89.95 59.95 59.95 79.95 79.95 89.95
#[13] 89.95 79.95 89.95 79.95 39.95 59.95 69.95 83.95 73.95 83.95 93.95 87.95
#[25] 91.95 99.95 61.95
A.K.
On Wednesday, January 29,
I've got a simple data.frame of a facotr variable called 'case' which indicates
one subject and a date of an event ('obs'), each row representing an
observation. One case can have many (or few) observations over time in the data
set.
I've created a crude data.frame by way of a clunky but
Dear Bert
In the example below, I use just one variable (apparently I mixed up the
formatting in the original mail) :
two_carmodel_data - mlogit.data(sample, choice = choice, shape = long,
alt.var = cl_vint_com, chid.var = gezinsid )
formula_2cars - mFormula(choice ~ pr_tot )
mod_res -
Hi there,
I'm currently using knitr to generate an html file, however the output of
my code is in a font size that's larger than I desire. I've been looking
through various options for controlling the font size of the code results,
such as the knitr manual, opts_chunk, and latex.
The actual code
use 'xtfrm' so the ranking:
set.seed(66)
d-(seq(as.Date(2001/01/01),as.Date(2011/12/31),days))
obs-(as.Date(sample(d,200,replace=TRUE)))
obs-as.data.frame(obs)
case-(case=(sample(LETTERS[1:8],200,replace=TRUE)))
case-as.data.frame(case)
df-cbind(case,obs)
df$rank-ave(xtfrm(df$obs),df$case,
On 29-01-2014, at 18:26, ce zadi...@excite.com wrote:
Thank you Berend, I will give it another shot to compile then.
Please send messages to the R-help list only.
I have forwarded this reply to R-help.
Berend
-Original Message-
From: Berend Hasselman [b...@xs4all.nl]
Date:
Le mardi 28 janvier 2014 à 11:51 -0800, Fisher Dennis a écrit :
Marc
I understand that R is staffed entirely by volunteers and I appreciate
the massive efforts that have created this awesome software. My
suggestion was aiming to encourage the Core team that one weakness of
the present
Dear R-Users,
I am trying to perform network analysis using BioNet. I am having
issues with the runFastHeinz function. I extracted the sub network and
computed the scores and fed to the function. I even tried to run the
function from the example data in the help function. I get the same
error.
Hi, I notice the following from a for loop in R, which seems strange to
me:
When I do this:
---
first - 0
nstep - 10
N - 14
while(first N)
{
print(--- )
last - first + nstep
if(last N)
last - N
#start - first+2
for(i in (first+2):last)# line 11
Dear friends,
I have a csv data entitled GFS in the following path:
c:\TEG
This data is attached with this mail.
When I wrote the following lines:
y=read.csv(c:\\TEG\\GFS.csv, header=FALSE, sep=;)
purtest(y, pmax = 4, exo = intercept, test = hadri)
I obtained the following message:
Error in
On 29/01/2014 11:32 AM, Supriya Jain wrote:
Hi, I notice the following from a for loop in R, which seems strange to
me:
When I do this:
---
first - 0
nstep - 10
N - 14
while(first N)
{
print(--- )
last - first + nstep
if(last N)
last - N
#start - first+2
for(i in
Tena koe
Not really strange: (7+2):11 is 9:11, 7+2:11 is 7+c(2,3,4,5,6,7,8,9,10,11);
i.e., 9:18
Peter Alspach
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Supriya Jain
Sent: Thursday, 30 January 2014 5:32 a.m.
To:
chke1993 wrote
I don't know the meaning of sep=,and don't know where to add the
location of the file such as E//...
sep= means the data you are reading is separated by a white/blank space.
sep=, would mean it is separated by a comma (,).
If the file is located in your working directory it
I'm trying to compute the Silhouette value of a clustering partition done with
SOM method using the function intCriteria of the clusterCrit package but it
returns me a Nan value: somebody knows why?
To simplify my case, here there is an example:
test
[,1] [,2] [,3] [,4]
Hello,
when I run this code in a brand new R session
--
### loading of libraries and other functions
Rprof(profiling.out)
start.time=proc.time()[3]
for(i in 1:50) {
main.function()
}
end.time=proc.time()[3]
Rprof()
Hi Barry,
I removed the lines related to memory size from other scripts and kept it only
in the master script. Now it works.
Cheers
Ahmed Kenawy
From: b.rowling...@gmail.com [b.rowling...@gmail.com] On Behalf Of Barry
Rowlingson
Hi Barry,
Thanks for your reply. Actually, I tried both max=TRUE and min=TRUE. Neither of
them works.
Ahmed Kenawy
From: b.rowling...@gmail.com [b.rowling...@gmail.com] On Behalf Of Barry
Rowlingson [b.rowling...@lancaster.ac.uk]
Sent: Wednesday,
If it is not in your working directory you need to
specify the path by something like.
file=C:users//documents//R//name.txt
No, Windows won't like the missing slash after the C: and using
a double forward slash is a bad habit to get into on Windows. Use one of
Dear R-help community,
I am creating my first R-package in RStudio and wanted to add datasets
to the package. I added an .RData file containing data (a data frame) in
the 'data' folder of the package and could load the data as usual by
typing in the console: data(xyz). Then I added a .RData
On 29/01/2014 2:49 PM, Kulupp wrote:
Dear R-help community,
I am creating my first R-package in RStudio and wanted to add datasets
to the package. I added an .RData file containing data (a data frame) in
the 'data' folder of the package and could load the data as usual by
typing in the console:
Dear all ,
xts objects give error in if command :
Error in if :
missing value where TRUE/FALSE needed
library(quantmod)
getSymbols(SPY)
SPY[2007-01-03]$SPY.Adjusted SPY[2007-01-04]$SPY.Adjusted
[,1]
If I use as.numeric function it works :
SPY[2007-01-03]$SPY.Adjusted
On Wed, Jan 29, 2014 at 1:25 PM, ce zadi...@excite.com wrote:
Dear all ,
xts objects give error in if command :
Error in if :
missing value where TRUE/FALSE needed
library(quantmod)
getSymbols(SPY)
SPY[2007-01-03]$SPY.Adjusted SPY[2007-01-04]$SPY.Adjusted
[,1]
If I use
Hi Arun
you can't open the file?
On Wed, Jan 29, 2014 at 9:23 PM, arun smartpink...@yahoo.com wrote:
Hi,
Your attachment didn't came through.
A.K.
On Wednesday, January 29, 2014 12:03 PM, george brida
george.br...@gmail.com wrote:
Dear friends,
I have a csv data entitled GFS in the
You should at least post the script so that we see what line 33 is.
For example, was it an input statement so that on the second time you
ran the data was cached in memory? Did you remove all the objects and
do a gc() to clean up memory before trying again (maybe there was some
data hanging
Ah ok. the problem is somewhat great, I can't rewrite it in txt file.
On Wed, Jan 29, 2014 at 10:48 PM, george brida george.br...@gmail.comwrote:
Ah ok. the problem is somewhat great, I can't rewrite it in txt file.
On Wed, Jan 29, 2014 at 9:52 PM, arun smartpink...@yahoo.com wrote:
HI
I think I have a hole in my understanding of how R uses packages (or at
least how it gives functions in packages priority). I thought I would give
the new dplyr package a test drive this morning (which is blazingly fast
BTW) and I've gone down the rabbit hole.
The issue is that I'm unable to use
In short, use dplyr::summarize or plyr::summarize to select the one you want.
HTH,
Peter
On Wed, Jan 29, 2014 at 2:19 PM, Trevor Davies davies.tre...@gmail.com wrote:
I think I have a hole in my understanding of how R uses packages (or at
least how it gives functions in packages priority). I
Hi Trever,
See help(::) and help(detach)
Best,
Ista
On Wed, Jan 29, 2014 at 5:19 PM, Trevor Davies davies.tre...@gmail.com wrote:
I think I have a hole in my understanding of how R uses packages (or at
least how it gives functions in packages priority). I thought I would give
the new dplyr
Thanks - that's solves my problems.
All the best - Trevor
On Wed, Jan 29, 2014 at 2:28 PM, Ista Zahn istaz...@gmail.com wrote:
Hi Trever,
See help(::) and help(detach)
Best,
Ista
On Wed, Jan 29, 2014 at 5:19 PM, Trevor Davies davies.tre...@gmail.com
wrote:
I think I have a hole in
If you load plyr first, then dplyr, I think everything should work.
dplyr::summarise works similarly enough to plyr::summarise that it
shouldn't cause problems.
Hadley
On Wed, Jan 29, 2014 at 4:19 PM, Trevor Davies davies.tre...@gmail.com wrote:
I think I have a hole in my understanding of how
Thanks to Dan Wang, Petr Pikal, Arun, Jim Holtman and Arun for all of your
solutions.
All the best,
KW
--
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Hi,
You can use dplyr:::summarise
For e.g.
library(plyr)
library(dplyr)
summarise
function (.data, ...)
--
}
environment: namespace:plyr
library(Lahman)
Batting %.% group_by(playerID) %.% summarise(total=sum(G))%.% head(5)
# total
#1 4988101
Batting %.%
Hi Hadley,
Thanks for getting back to me - the dplyr package seems really great.
The issue I have is that the groupings no longer works when I'm using the
plyr::summarise function
Here is my code, I think it's pretty obvious what I'm trying to do:
data_df - tbl_df(full.data)
group_year -
R Experts -
We have a complex problem whereby Qualtrics exported our data into a single
cell as seen below.
We attempted to parse it using scan() without much success. Hoping to get a
little nudge here. I've posted the full data set here:
I would like to take a parameter passed to a function as a text string. I don't
want the parameter evaluated, I want it uses exactly as passed,
doit - function(data) {
cat(This function is using values from the data frame ,data,\n)
}
mydata - data.frame(x = c(1,2,3), y=c(3,2,1))
doit(mydata)
doit - function(data) {
cat(This function is using values from the data frame,
deparse(substitute(data)), \n)
}
On Wed, Jan 29, 2014 at 6:48 PM, John Sorkin
jsor...@grecc.umaryland.edu wrote:
I would like to take a parameter passed to a function as a text string. I
don't want the parameter
Use substitute(argumentName) to get the literal argument, as a language object,
and deparse() to convert that into a character vector. That vector could be
quite
long (especially what your function is called via do.call) so you may want to
truncate it.
doit2 - function (data)
{
dataName
On Jan 29, 2014 5:47 PM, Trevor Davies davies.tre...@gmail.com wrote:
Hi Hadley,
Thanks for getting back to me - the dplyr package seems really great.
The issue I have is that the groupings no longer works when I'm using the
plyr::summarise function
That is presumably why you should load
Hello,
Your example is difficult to reproduce.
Please
1. use dput() to attach data
2. indicate the package(s) you used. There are at least 3 packages
with a som function. It seems you used RSNNS.
And when I run your code, there is no unit.classif in datissimi
datissimi$unit.classif
NULL
Please provide a minimal example -- are you using R Markdown or R
HTML? Both can produce HTML output:
http://yihui.name/knitr/demo/minimal/
Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Web: http://yihui.name
On Wed, Jan 29, 2014 at 10:49 AM, Jeff Johnson mrjeffto...@gmail.com wrote:
Hi
Hello,
Please also reply to the list.
I am not really familiar with this calculation, but it is maybe due to
the fact you defined 8 nodes for your SOM, but your original data are
only classified within 3 nodes.
datissimi = som(test, grid=somgrid(xdim=2, ydim=4, topo='rectangular'),
rlen=500,
Thank you Yihui for responding. I'll reply with details when I get in the
office tomorrow am. I'm using Rstudio and added the knitr package if that
helps. I'll check details and provide an example tomorrow am.
I appreciate your help.
Sent from my iPhone
On Jan 29, 2014, at 5:57 PM, Yihui
Thanks, Duncan!
I installed a hex viewer -- did not realize there was also one in R.
I found the documentation for the individual showNonASCII and
showNonASCIIFile functions, but I could not find the usual package PDF. The
tools package does not seem to be listed on cran in the alphabetical list
Also:
xNew - x
for(i in 1:4){
xNew - xNew+0.5
assign(paste(y,i,sep=),xNew)
}
identical(x2,y2)
#[1] TRUE
identical(x3,y3)
#[1] TRUE
A.K.
On Wednesday, January 29, 2014 11:35 PM, arun smartpink...@yahoo.com wrote:
Hi,
May be this helps:
set.seed(24)
x-rnorm(10)
vec1 - seq(0.5,2,by=0.5)
Hi,
May be this helps:
set.seed(24)
x-rnorm(10)
vec1 - seq(0.5,2,by=0.5)
for(i in 1:4){
assign(paste(x,i,sep=),x+vec1[i])
}
A.K.
Hi all, I have been trying to figure this one out but I'm at a dead end. I want
to write a loop that automatically create a series of values
based on a
Oh wow, I guess I get it!
Thank you. It is pretty tricky but I saw that it works very fast.
On Wed, Jan 29, 2014 at 9:31 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote:
On 14-01-29 6:41 AM, Bill wrote:
Hi. I saw this example and I cannot begin to figure out how it works. Can
anyone give
On Jan 29, 2014, at 7:27 PM, Andrew Hoerner wrote:
Thanks, Duncan!
I installed a hex viewer -- did not realize there was also one in R.
I found the documentation for the individual showNonASCII and
showNonASCIIFile functions, but I could not find the usual package PDF. The
tools package
For Census data specifically you might want to look at the acs package.
I learned about it from
Ray DiGiacomo, Jr. r...@liondatasystems.com
I am doing an R-oriented US Census webinar on August 29.
See this site for the recording of the webinar.
http://liondatasystems.com/rug.html
I think you
Hello Jim, thanks for the reply!
What I'm trying to do:
I have a small function that makes use of many other functions, such as the
one I called estimate.NAC.structure.of()
I'm trying to make run everything faster. Thus I'm using Rprof to perform a
line by line profiling to help me decide what
72 matches
Mail list logo