Displaying 20 results from an estimated 83 matches for "rydevik".
2008 Nov 05
2
Simple rep() question duplicating times and dates.
I want to create a data.frame of time and date for a year. I started with the idea of simply producing two vectors (time and date)
The first part ( time) is easy.
rep(1:24, 365)
But how do I get a series of 24 dates for O1 January 2005 and repeat this to 31 December 2005.
It should be easy but I don't see it.
Thanks
2006 Dec 08
2
Aggregate?
...sum)
Error in data.frame(w, lapply(y, unlist, use.names = FALSE)) :
arguments imply differing number of rows: 26, 0
I thought this would give me a list containing the number of ones that
"belong" to each letter. What am I doing wrong?
Thanks in advance,
Gustaf
--
email:gustaf.rydevik at gmail.com
tel: +46(0)703051451
address: Kantorsgatan 50:190 75424 Uppsala Sweden
2010 Jun 22
1
New errors with difftime()-objects in 2.11.1 (was Re: Request: difftime method for cut())
On Thu, Jun 10, 2010 at 3:39 PM, Gustaf Rydevik
<gustaf.rydevik at gmail.com> wrote:
> Hi all,
>
> The recent change in 2.11 that made as.numeric() return false on
> difftime-objects broke some of my code that calculated age classes of
> individuals using cut(). While this was no big thing to fix for me, it
> might be wis...
2010 Jun 22
1
New errors with difftime()-objects in 2.11.1 (was Re: Request: difftime method for cut())
On Thu, Jun 10, 2010 at 3:39 PM, Gustaf Rydevik
<gustaf.rydevik at gmail.com> wrote:
> Hi all,
>
> The recent change in 2.11 that made as.numeric() return false on
> difftime-objects broke some of my code that calculated age classes of
> individuals using cut(). While this was no big thing to fix for me, it
> might be wis...
2007 Oct 10
2
download.file not working
Hi all,
I'm trying to download a file from the net, and the download.file
command leaves it corrupted, i.e excel cannot open it. It seems as if
it's going ok, however.
Does anyone have an idea of what's going on?
regards,
Gustaf Rydevik
----
>download.file(url="http://www.who.int/entity/whosis/whostat2006_demographics.xls",destfile="whodem.xls")
trying URL 'http://www.who.int/entity/whosis/whostat2006_demographics.xls'
Content type 'application/vnd.ms-excel' length 77824 bytes
opened URL
dow...
2009 Dec 14
6
write.csv and header
Dear list,
I would like to export a matrix to a TXT-File by using write.csv (not
necessarily). Is there a way to add a header (with additional
informations concerning the project) spanning multiple lines to this
file before the actual data are listed up? Should look like this:
date:
filename:
number of permutations:
------------
data (as a matrix)
Any suggestions? Thnx in advance.
2007 Jul 13
2
The "$" operator and vectors
...ting function.
consider:
> Test
A B
1 1 Q
2 2 R
> Test$A
[1] 1 2
> vector<-"A"
> Test$vector
NULL
> Test$"A"
[1] 1 2
> Test[,vector]
[1] 1 2
Is there a reason for the $ operator not evaluating the vector before executing?
best,
Gustaf
--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451 /+46(0)8 760 52 93
address: C/O Rydevik, Syrenv. 12, 17851 Eker?, SE
skype:gustaf_rydevik
2009 Jan 20
1
two-sample test of multinomial proportion
...r of tests. But this seem to skip some
information regarding variance of H1/H3 in the two groups, so I don't
think it is correct.
I've tried using a bootstrap approach on the ratio of the two
proportions, but there must be a smarter way.
Any help is much appreciated!
Best regards,
Gustaf Rydevik
####data and bootstrap attempt ###
multi.data<-data.frame(
group=c("a","b"),
H1=c(2,12),
H3=c(21,46),
tests=c(189,411)
)
multi.ind<-data.frame(Type=
rep(c("H1","H3","Neg"...
2008 Jan 09
7
An "R is slow"-article
...rch/00000041.htm
While I don't agree (granted, I can't really write C), it was
interesting to read something from a very different perspective than
I'm used to.
Best regards,
Gustaf
_____
Department of Epidemiology,
Swedish Institute for Infectious Disease Control
work email: gustaf.rydevik at smi dot ki dot se
skype:gustaf_rydevik
2008 Oct 07
1
FW: Reading Data
...atrix(0,length(q_sd),1)
for(i in 1:length(q_sd))
{
for(j in 1:length(q_ins))
{
wt_ret[i]=wt_ret[i]+(wt[j]*matrix_ret[j,i])
}
}
result=cbind(q_ed,wt_ret)
Rahul Agarwal
Analyst
Equities Quantitative Research
UBS_ISC, Hyderabad
On Net: 19 533 6363
-----Original Message-----
From: Gustaf Rydevik [mailto:gustaf.rydevik@gmail.com
<mailto:gustaf.rydevik@gmail.com> ]
Sent: Tuesday, October 07, 2008 2:19 PM
To: Agarwal, Rahul-A
Cc: R-SIG-robust@r-project.org; r-help@r-project.org
Subject: Re: [R] Reading Data
On Tue, Oct 7, 2008 at 10:36 AM, <Rahul-A.Agarwal@ubs.com> wrote:
>
&...
2010 Jun 03
2
moving average on irregular time series
...UE, TRUE, TRUE, FALSE, FALSE, FALSE,
TRUE, FALSE, FALSE, FALSE)), .Names = c("Datebegin", "Event"
), row.names = c(NA, 20L), class = "data.frame")
###In this example, row 18 is a date less than 14 days after an event
and should be marked for removal.
--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik
2008 May 23
2
Preparing high quality figures with tiff as end result
...nts() works for this, but the result is that text becomes
low-res bitmaps, and I don't know how to solve this.
So basically my question is: How should I go about generating graphics
that will look as nice as possible given the above constraints?
Many thanks in advance,
Gustaf
--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik
2009 Dec 28
2
WHO Anthro growth curve macros and R
...es directly.
Has anyone on the list tried using the WHO anthro macros with R, and
can tell me how they did it?
Alternatively, could some, very kind, person try and open the Splus
files, and save them in a R-readable format?
I would be extremely grateful for any help on this.
Best regards,
Gustaf Rydevik
--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik
2008 Apr 08
1
Change the position of panel strips in a lattice plot.
...overlap=.1)
xyplot(lat ~ long | Depth, data = quakes)
,is there any way to make "Depth" appear below the subgraphs, instead of above?
I've been looking through the lattice documentation and the list
archive but have not found such a thing.
Many thanks in advance,
Gustaf
--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik
2009 Feb 11
3
Generating Numbers With Certain Distribution in R
Dear all,
Is there a way to generate K numbers of integer (K = 10^6).
The maximum value of the integer is 200,000 and minimum is 1.
And the occurrences of this integer follows
a lognormal distribution.
- Gundala Viswanath
Jakarta - Indonesia
2009 Apr 15
1
"utils" lacking namespace?
...losed the program.
Now when she starts R, "utils" can't be loaded which of course create
an unworkable environment.
Below I've copy-pasted the error message she gets when starting R.
Any ideas on what went wrong, and more importantly, how to fix it?
Many thanks in advance,
Gustaf Rydevik
Ps: She's running R on a WinXP box, if that might be of relevance...
----------------------------
Error : package 'utils' does not have a name space
R version 2.8.1 (2008-12-22)
Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0
R is free software and...
2006 Dec 01
3
Vertical line in densityplot?
...coordinates?
Additionally, it would be nice to have standard xy-axis, and to have
the line stop at the x-axis, so if anyone could tell me how to do
that, I'd be grateful.
Thanks in advance,
Gustaf
PS: a minor question: Why do I have to call plot.new() for abline to work?
--
email:gustaf.rydevik at gmail.com
tel: +46(0)703051451
address: Kantorsgatan 50:190 75424 Uppsala Sweden
2008 Dec 11
3
getting ISO week
...y if the date is in the beginning,middle or
end of the year
Wn<-ifelse(
Yn==Y-1,
ifelse((jan1.wday==5|(jan1.wday==6 &LY.prev)),53,52),
ifelse(Yn==Y+1,1,(date.yday+(7-date.wday)+(jan1.wday-1))/7-(jan1.wday>4))
)
return(list(Year=Yn,ISOWeek=Wn))
}
--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik
2007 Sep 14
3
x-axis order
...o week 25 the following year. How do I plot this data, so that the
x-axis is displaying the week numbers, ordered as in the data?
Thanks in advance,
Gustaf
---
x<-c(26:52,1:25)
y<-rnorm(52)+1:52
plot(x,y) ## How do I get the x axis to be ordered by the current
ordering of x?
--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik
2007 Sep 28
2
Is there a model like that in R?
Hi to everyone,
I am starting to work with a model that is not familiar to me.
The model would be like that:
y = . - a*max(Q(i) - Q(0), 0) + .
where Q(i) is the accumulated effect of a variable at time i and Q(0) a
threshold above it there is effect on y. The value of Q(i) could be
estimated as:
Q(i+1) = Q(i) + b*max(s(i) - s(0), 0) + c*min(s(i) - s(0), 0) + .
Where s