Hi,
Not quite understand the question.
Do you want to select only certain columns or rows without NAs?
Suppose, I have a dataset such as the one below:
dattrial<-data.frame(a=c(1,NA,rnorm(4,10)),b=c(NA,NA,NA,3,4,6),c=c(sample(LETTERS[1:3],replace=TRUE),
sample(LETTERS[3:5],3,replace=TRUE)),d
stop repeating yourself. and stop asking us to do your work.
Try reading the posting guide. Give us an example of the output you DO want.
Show us the code you already have. Use the dput function to give us example
data to work with. Learn to use the str function so you know what data you are
re
Dear Justin,
anova() and Anova() are entirely different functions; the former is part of the
standard R distribution and the second part of the car package. By default,
Anova() produces an error for type-III tests conducted on rank-deficient models
because the hypotheses tested aren't generally
On Jun 16, 2012, at 1:56 PM, capital_P wrote:
>
> David Winsemius wrote
>>
>>> Try
>>>
>>> dat2 <- data.frame(do.call(cbind, dat), stringsAsFactors=FALSE)
>>
>> Use instead:
>>
>> dat2 <- data.frame( dat, stringsAsFactors=FALSE)
>>
>
> Both do not seem to work:
>
>> dat2 <- data.frame(d
Hello,
I'm quite new to R and still spend hours trying to figure out single things
so I hope nobody rolls his eyes over my question.
I have a data set over time and converted it to the POSTIXct format. I added
a column in the data set for the week and the month.
I try to get a plot which shows
David Winsemius wrote
>
>> Try
>>
>> dat2 <- data.frame(do.call(cbind, dat), stringsAsFactors=FALSE)
>
> Use instead:
>
> dat2 <- data.frame( dat, stringsAsFactors=FALSE)
>
Both do not seem to work:
> dat2 <- data.frame(do.call(cbind, dat), stringsAsFactors=FALSE)
Error: cannot allocate vect
Dear John,
Thank you very much for the quick answer. I will use the mentioned
citation of your book in the future.
However:
The Id argument is necessary for the function to know that the different
rows belong to one individual.
Or how the Help-File says:
id:
optional variable name of subje
Hi Al, Michael,
On Sat, Jun 16, 2012 at 11:01 AM, R. Michael Weylandt
wrote:
> On Fri, Jun 15, 2012 at 6:56 AM, Al Ehan wrote:
>> Hi,
>>
>> I would like to make a replication of 10 of a linear, first order
>> Autoregressive function, with respect to the replication of its innovation,
>> e. for e
hello,
I am trying to implement the bootstrapping to a set of insurance claim data
in triangular form using the ChainLadder package. I want to obtain the
prediction errors of the reserve estimate using the result from
bootstrapping, here is the output:
>BootChainLadder(Triangle = incr2cum(data)
I have the same problem. How did you end up solving yours?
--
View this message in context:
http://r.789695.n4.nabble.com/strang-behaviour-of-mice-package-tp3679224p4633609.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-proje
Dear Mr. Therneau, Mr. Fox, or to whoever, who has some time...
I don't find a solution to use the "survfit" function (package:
survival) for a defined pattern of covariates with a Cox-Model
including a time dependent interaction term. Somehow the definition of
my "newdata" argument seems to
Hi Joshua,
Thank you very much for the comprehensive response.
In the meantime, I had taken a look at the source code of function DEoptim()
and your example below confirms the conclusions that I have arrived at from
that review as to the expected nature of the function passed as fnMap. What I
Hello again and thank you all so much for the help. Well, I tried and did it
myself, here's what I wrote:
library(tnet)
net <- read.table("data.txt")
net <- as.tnet(net, type="longitudinal tnet")
loop <- range(net[,1])
net.static <- vector(length=as.integer(loop[2]-loop[1])+1, mode="list")
j <- 1
see below.
On Fri, Jun 15, 2012 at 11:53 PM, wrote:
> Dear Mr.Kjetil,
>
> Thanks for your comment. You have already pointed me the article in reply to
> one of my earlier post to this list and I am following the paper. Now I am
> checking for condition for positive definiteness for original ma
Dear R users,
I have a panel data set (in MS excel) on prices across countries and time
countrytime price
1 "23/11/08"2
1 "28/12/08" 3
1"25/01/09" 4
1 "22/02/09" 5
1"29/03/09"
David,
On Sat, Jun 16, 2012 at 2:41 PM, David-Michael Lincke
wrote:
> Hi Joshua,
>
> Thank you very much for the comprehensive response.
>
> In the meantime, I had taken a look at the source code of function
> DEoptim() and your example below confirms the conclusions that I have
> arrived at from
Hi
The devil is in the detail of the components so here is a toy example
to give you an idea in 2D but 5D
It is somewhat easier to interpret if you condition. You may be able
to visualize in 3D not all can.
3D can be a problem if distinguishing points are 180 degrees apart in
the preferred vie
On Sat, Jun 16, 2012 at 8:19 AM, stef salvez wrote:
> I have a panel data set (in MS excel) like the one below
>
>
> 1 "23/11/08" 2
> 1 "28/12/08" 3
> 1 "25/01/09" 4
> 1 "22/02/09" 5
> 1 "29/03/09"
On Jun 16, 2012, at 3:18 PM, Charles Berry wrote:
zoeita live.co.uk> writes:
Hi,
I have had a look around the forums and I can't seem to find
anything that
works with my data. I have lats, longs, time, tidal speed and
direction and
need to plot this in an xy plot to determine changes
zoeita live.co.uk> writes:
>
> Hi,
>
> I have had a look around the forums and I can't seem to find anything that
> works with my data. I have lats, longs, time, tidal speed and direction and
> need to plot this in an xy plot to determine changes over time. contour and
> cloud have been recomm
Thank you all for the useful replies. I will go with the list of
matrices idea as suggested multiple times.
On Sat, Jun 16, 2012 at 6:50 PM, Jeff Newmiller
wrote:
> A data frame is a list of vectors all with the same length. Note that vectors
> have simple types. Sticking other types of object
michaelyb gmail.com> writes:
>
> To whoever is looking for the same thing as I was,
> I found a solution, or
> sort of.
> Here is the code:
>
> flavors<-c("vanilla", "chocolate", "strawberry")
>
> w <- gwindow("checkbox example")
> gp <- ggroup(container=w)
> glabel("Favorite flavors:",con
On Sat, Jun 16, 2012 at 2:11 AM, Stephen Eglen wrote:
> R does a great job with the fine details regarding plots. e.g in the
> following:
>
> library(lattice)
> y <- -4:4/10
> xyplot(y~1, las=1)
>
>
No. las is a parameter in base graphics ?par. It was simply ignored here:
xyplot(y~1,scales=list(
A data frame is a list of vectors all with the same length. Note that vectors
have simple types. Sticking other types of objects into it violates the generic
constraint stated above, leading to incompatibility with many functions that
normally work with data frames.
If you want to maintain data
Hi Ken, Stef,
We can make your script more elegant like below:
On Sun, Jun 17, 2012 at 12:52 AM, Ken wrote:
>
> stef salvez googlemail.com> writes:
[snip]
> #load library
> library(plyr)
>
> # utility function
> mean.var = function(df, var){ mean(df[[var]], na.rm = T)};
>
> # create example
On Sat, Jun 16, 2012 at 06:14:38PM +0100, Onur Uncu wrote:
> Thank you. But isn't a data frame already a list?
Data frame is a list of columns. The suggestion was to use a list,
whose length is the number of rows and which contains a matrix
for each row.
> What is wrong with
> adding a column to
Hello,
Follow this example. It uses a list to hold the mortality curves.
Since there are only two different gender/age combinations, it first
gets all such unique combinations and then creates a list of the
appropriate length. Then assigns a matrix to the first list element.
DF <- read.table(
Thank you. But isn't a data frame already a list? What is wrong with
adding a column to the existing data frame (a column with the
mortality curve matrices)?
Sorry if I am being difficult. Just want to learn good design in R.
On Sat, Jun 16, 2012 at 5:49 PM, steven mosher wrote:
> use a list.
Hi All,
I'm working on analyzing a large data set, lets asume that
dim(Data)=c(1000,8700). I want to calculate the canberra distance
between the columns of this matrix, and using a toy example ('test' is
a matrix filled with random numbers 0-1):
> system.time(d<-as.matrix(dist(t(test), method = "
stef salvez googlemail.com> writes:
>
> I would like to clarify that since each observation is obtained every
> 28 days, each such observation is a 4-week average
>
> thanks
>
> On 6/16/12, stef salvez googlemail.com> wrote:
> > I have a panel data set (in MS excel) like the one below
> >
>
use a list. or create new class which is a list
On Jun 16, 2012 8:52 AM, "Onur Uncu" wrote:
> Hello R Community,
>
> I have the following design question. I have a data set that looks
> like this (shortened for the sake of example).
>
> Gender Age
> M 70
> F 65
> M
Hello R Community,
I have the following design question. I have a data set that looks
like this (shortened for the sake of example).
Gender Age
M 70
F 65
M 70
Each row represents a person with an age/gender combination. We could
put this data into a data frame.
N
Dear Jurgen,
> fit <- survfit(mod.allison.5, newdata.1, individual=TRUE)
> fit
Call: survfit(formula = mod.allison.5, newdata = newdata.1, individual = TRUE)
records n.max n.start events median 0.95LCL 0.95UCL
19809 432 432 114 NA NA NA
plot(fit) # shows one s
I would like to clarify that since each observation is obtained every
28 days, each such observation is a 4-week average
thanks
On 6/16/12, stef salvez wrote:
> I have a panel data set (in MS excel) like the one below
>
>
> 1 "23/11/08"2
> 1 "28/12/08" 3
On Fri, Jun 15, 2012 at 3:25 AM, Jannis wrote:
> Hey R folks,
>
>
> i found some strange (to me) behaviour with chron to POSIXct conversion. The
> two lines of code result in two different results, on ewith the correct time
> zone, one without:
>
> library(chron)
> as.POSIXct(chron('12/12/2000'),
Dear Jürgen,
All the values of your Id variable are equal to 1; how can that make sense?
Removing the argument Id=id may get you what you want.
By the way, the document to which you refer was an appendix to a 2002 book that
has been superseded by Fox and Weisberg, An R Companion to Applied Regr
Stephen, for ggplot2 you might want to check http://goo.gl/0Wx0B
On Sat, Jun 16, 2012 at 4:40 AM, Stephen Eglen wrote:
>
> A recent paper on visualisation (in Neuron, a leading neuroscience
> journal) surveyed how well previous articles in this journal labelled their
> graphs (e.g. axis labelling
Hello,
I tried this posted on the R devel subforum but no help so far. Maybe the
wider net will be fruitful. Probably a pretty simple issue.
The short story goes, I'm writing C source code and compiling it in as *.dll
in the windows terminal by R CMD SHLIB foo.c. It works, I'm on a 64-bit
system
Hi,
I have had a look around the forums and I can't seem to find anything that
works with my data. I have lats, longs, time, tidal speed and direction and
need to plot this in an xy plot to determine changes over time. contour and
cloud have been recommended to me as a way to do this but I can't
I have a panel data set (in MS excel) like the one below
1 "23/11/08"2
1 "28/12/08" 3
1"25/01/09" 4
1 "22/02/09" 5
1"29/03/09" 6
1 "26/04/09" 32
1 "24/05/09"
I'm using the package 'lars' in R with the following code:
> library(lars)
> set.seed(3)
> n <- 1000
> x1 <- rnorm(n)
> x2 <- x1+rnorm(n)*0.5
> x3 <- rnorm(n)
> x4 <- rnorm(n)
> x5 <- rexp(n)
> y <- 5*x1 + 4*x2 + 2*x3 + 7*x4 + rnorm(n)
> x <- cbind(x1,x2,x3,x4,x5)
> cor(cbind(y,x))
y
On 06/16/2012 07:41 AM, @ngel wrote:
Hello all,
I'm new here and new to R, but I have to admit I'm learning rather fast.
Right now I need to write a loop, and I don't seem to think I'm doing it
properly, judging by the errors I get! What I need to do is to insert my
data (csv-table) into a variab
A recent paper on visualisation (in Neuron, a leading neuroscience
journal) surveyed how well previous articles in this journal labelled their
graphs (e.g. axis labelling and describing their error bars). Of
particular interest is that (only) 40% of plots labelled what their
colorkey was showing
R does a great job with the fine details regarding plots. e.g in the
following:
library(lattice)
y <- -4:4/10
xyplot(y~1, las=1)
the y axis is labelled with numbers -0.4, -0.2, 0.0, 0.2, 0.4 with the
numbers aligned on the decimal point.
How do I get the same behaviour in the colorkey of a lev
On Jun 16, 2012, at 1:01 AM, Jeff Newmiller wrote:
Why would a date function have
a TZ? `as.Date` wouldn't.
This statement seems nonsensical to me. POSIXt objects have tzone
attributes.
I earlier expressed surprise at this statement based on:
attributes(as.POSIXct(chron('12/12/2000'),
On Jun 16, 2012, at 1:01 AM, Jeff Newmiller wrote:
Why would a date function have
a TZ? `as.Date` wouldn't.
This statement seems nonsensical to me. POSIXt objects have tzone
attributes.
They do?
--
David.
Date and chron objects do not. Since they do not include tzone,
logically the us
Hello all,
I'm new here and new to R, but I have to admit I'm learning rather fast.
Right now I need to write a loop, and I don't seem to think I'm doing it
properly, judging by the errors I get! What I need to do is to insert my
data (csv-table) into a variable, and take snapshots of my data (it'
not quite an R package, but one way of taking advantage of R would be to
use something like treeplan http://goo.gl/wHsb6 along with RExcel
http://goo.gl/ToD77
On Thu, Jun 14, 2012 at 11:34 AM, stefan.d...@gmail.com <
stefan.d...@gmail.com> wrote:
> Hi Noah,
>
> I did ask basically the same questi
48 matches
Mail list logo