Displaying 6 results from an estimated 6 matches for "citycodes".
Did you mean:
citycode
2018 Mar 25
3
Take average of previous weeks
Dear all,
I have weekly data by city (variable citycode). I would like to take the
average of the previous two, three, four weeks (without the current week)
of the variable called value.
This is what I have tried to compute the average of the two previous weeks;
df = df %>%
mutate(value.lag1 = lag(value, n = 1)) %>%
mutate(value .2.previous = rollapply(data = value.lag1,
2016 Apr 20
1
Use multiple cores on Linux
I am trying to run the following code in R on a Linux cluster. I would like
to use the full processing power (specifying cores/nodes/memory). The code
essentially runs predictions based on a GAM regression and saves the
results as a CSV file for multiple sets of data (here I only show two).
Is it possible to run this code using HPC packages such as
Rmpi/snow/doParallel? Thank you!
2018 Mar 25
0
Take average of previous weeks
I am sure that this sort of thing has been asked and answered before,
so in case my suggestions don't work for you, just search the archives
a bit more.
I am also sure that it can be handled directly by numerous functions
in numerous packages, e.g. via time series methods or by calculating
running means of suitably shifted series.
However, as it seems to be a straightforward task, I'll
2018 Mar 26
1
Take average of previous weeks
Dear Bert,
Thank you very much.This works. I was wondering if the fact that I want to
create new variables (sorry for not stating that fact) makes any
difference? Thank you again.
Sincerely,
Milu
On Sun, Mar 25, 2018 at 10:05 PM, Bert Gunter <bgunter.4567 at gmail.com>
wrote:
> I am sure that this sort of thing has been asked and answered before,
> so in case my suggestions
2001 Nov 27
3
Equations as arguments to functions
...t;- eq}
a _ rnorm(100)
go(10,eq=a[.5*length(a)]+C+1)
> C
[1] 20
> d
[1] 21.10551
> a[.5*length(a)]
[1] 0.1055086
Everything looks good - (BTW seems like a really powerful feature of R)
Now on to my code of interest, which doesn't work (shown below).
rm(list=ls())
load("datasets/citycodes")
increments _ seq(5000,100000,by=5000)
makeindex <- function(Y,eq) {
losers _ 0; levels_0
index _ 0; location _ 0; cutoff _0; totalapt_0; houses_0
for (C in city[1:2]) {
counter _ 0
if (file.exists(paste("datasets/2000income/",C,sep=""))) {
load(paste("da...
2006 Jan 27
3
OT?: International number parsing
Can anyone shed some light on "rules" that might make the task of
parsing the country code and city codes from a dialed number in the
CDRs?
I know that there is almost never a case where a concatenated country
and city code could overlap with another country code, but what about
city codes and local numbers? Is it possible for a concatenated city
code and local number to match another