Displaying 20 results from an estimated 40000 matches similar to: "Week number calculation"
2010 Mar 15
1
Assigning a sequence to a subsetted data frame variable
Hey folks,
I have a difficult (at least for me) problem that I was hoping
one of you may know how to solve. I want to assign a sequence
to subsets of a variable in a data frame based on date.
The variable is 'SITE1' and the date is a unique day (DD) and
month (MM) combination. The sequence contains site numbers 101:104,
and each day-month combination takes four site numbers from that
2010 Jul 20
1
ifelse() and missing values in test conditions
R experts,
I have been unable to get the following ifelse statement to work as desired when applied
to my data frame.
Example:
DF$ANYEF <- with(DF,ifelse(PSOUGHT1=='ANY'|PSOUGHT2=='ANY'|PSOUGHT3=='ANY',PEFF,0))
##### this statement will be replicated 16 times for 16 unique _EF variables ###
Basically, I want each ANYEF for each row to equal the corresponding row
2010 Mar 05
2
How to assign week numbers to a time-series
Hello everyone,
My progress has stalled on finding a way of creating a somewhat complicated variable to add to my existing dataframe and I am hoping one of you could help me out. The dataframe below contains only a fraction of the data of my complete dataframe, but all of the variables. What I want to do is add another variable named 'WEEK' to this dataframe that is assigned 1 for row 1
2010 Mar 12
6
Randomly sampling subsets of dataframe variable
Fellow R users,
I am stumped on what would seem to be something fairly simple.
I have a dataframe that has a variable named 'WEEK' that takes
the numbers 1:26 (26 week time-period) with each number repeated
five times consecutively (once for each weekday, Monday through
Friday). Ex. 111112222233333.....2626262626. I would like to
randomly extract two weekdays per five day week for
2010 Mar 23
3
Converting date format
R community:
Hello, I would to like to convert a character date variable from %m/%d/%Y to %m/%d/%y. Any advice would be greatly appreciated. I have tried functions for changing the formatting and removing the unnecessary digits without success.
Mike
2011 Mar 22
2
Infinite loop
R experts,
Hello, I am trying to sample a vector 1:40 without replacement such that no element in the new vector
is within 7 units of either of its immediate neighbors. This is part of a larger program I am working
on. The following code works well about 65 % of the time (14/40). The problem I encounter happens when
the last element remaining to be sampled from the vector STRATA is within 7
2010 Mar 17
3
Adding minutes to 24 hour time
Hi,
Does anyone know how to add minutes (up to 100 min) to a 24 hour time, to create a new 24 hour time? I can't seem to find any documentation or examples explaining how to do this. The variables of interest are 'ARRIVE','WAIT', and 'DEPART' in the attached partial dataframe. I want 'DEPART' to be the "sum" of 'ARRIVE' and 'WAIT' in
2010 Apr 20
5
Assigning Week Numbers
R experts,
How could I extract the week number from a date vector (in Date class)
such that week numbering (week 1...2...) begins (May 01) and ends
(October 31) on the same specific dates each year? Week numbering
must conform to the following day numbering format (Sat=1,Sun=2,Mon=3.....Fri=7).
This means that new weeks must begin on Saturdays, and end on Fridays
(except for the first date
2002 Apr 11
6
extract week from date
Hello R-users,
Does anyone know how obtain the week of a date?
(in SPPS the instruction is "xdate.week")
Thanks,
Juan Ramon
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the
2010 Mar 18
2
Dataframe manipulation
Hello R users,
I spent most of my workday yesterday trying unsuccessfully to
write code that will perform a series of calculations on my
dataframe (partial copy is attached). What I need to do is
multiply the 24 hr time in the 'DEPART' column by the time
(in the 'TRAVEL' column (travel time in minutes), and store this
result in the 'ARRIVE' column for the following
2010 Mar 16
2
Conditional variable assignment
Hi everyone,
Once again I am stuck with a problem I can't seem to figure out. I suppose this learning curve levels off eventually, lol. I am learning on my own with absolutely no background in programming, so if I seem to request help a lot it's not because I am seeking others to do the work for me. I need to assign one of two arrival times to the 'ARRIVE' variable of my
2010 Mar 10
0
FW: How to assign week numbers to a time-series (additional question)
I want to thank everyone who has provided me advice on how to solve this problem, it was all very helpful. However, I am still left with one issue remaining. All of the methods provided still require me to input the origin date, which to lead to correct week number assignment, must be the last Saturday prior to the survey start date of May 01 or May 01 if that date happens to be a Saturday. I
2010 Mar 10
0
How to assign week numbers to a time-series (duplicate message in plain text formatting)
I want to thank everyone who has provided me advice on how to solve this problem, it was all very helpful. However, I am still left with one issue remaining. All of the methods provided still require me to input the origin date, which to lead to correct week number assignment, must be the last Saturday prior to the survey start date of May 01 or May 01 if that date happens to be a Saturday. I
2010 Mar 19
2
Dataframe calculations
Hi everyone,
My question will probably seem simple to most of you, but I
have spent many hours trying to solve it. I need to perform
a series of sequential calculations on my dataframe that move
across rows and down columns, and then repeat themselves at
each unique 'MM' by 'DD' grouping. Specifically, I want to add
'DEPART' time (24 hr time) to 'TRAVEL'(minutes)
2010 Mar 25
4
Creating dataframe of all possible variable combinations
Hello,
I need to create a dataframe containing all possible combinations of three variables: SITE (101,102,103,104), WDAY (MON,TUE,WED,THR,FRI), and TOD (MORN, AFTN). There should be a total of 40 unique combinations in my dataframe. I used expand.grid() successfully(?) to create my dataframe, but then when I went to order it by SITE, the resultant dataframe only contained four rows, one for each
2018 Jan 26
1
[PATCH] ISOLINUX: Fix checksum calculation in lzo/prepcore.c
The prescription for Boot Info Table says that checksumming begins
at byte 64 of isolinux.bin. When prepcore writes isolinux.bin it begins
copying bytes from the input file at the offset given by variable "start".
But it begins checksumming at offset 64 of the input file.
The problem exists since introduction of prepcore by release 4.00.
ISO 9660 programs usually fix it when they write
2010 Aug 13
1
assign multiple variables at once
R Experts,
I would like to create a series of variables without having
to assign a separate line of code for each new variable. My dataframe (DF) contains
two groups of linked variables (ESP1:ESP9) and (ECRL1:ECRL9). Within ESP1:ESP9 are
abbreviated species codes (full dataframe contains 26 codes). ECRL1 represents the
number of species x in variable ESP1 harvested, and so on through ESP9 and
2019 Sep 25
2
USB thumb drive for CentOS 7.7 to install
I took the "everything" iso and did the dd command to my 16G thumb drive.
I booted and entered my usual ks=http://xxx on the boot line. All good so
far.
It gets my kickstart file and installation begins.
At some point it says
Installing libreoffice-opensymbol-fonts (492/1948)
Retrying download of 1:libreoffice-opensymbol-fonts-5.3.6.1-21.el7.norarch
then after 10 retries it fails.
I
2005 Oct 11
6
adding 1 month to a date
Within an R dataset, I have a date field called “date_”. (The dates are in the format “YYYY-MM-DD”, e.g. “1995-12-01”.)
How can I add or subtract “1 month” from this date, to get “1996-01-01” or “ “1995-11-01”.
---------------------------------
[[alternative HTML version deleted]]
2010 Oct 26
4
divide column in a dataframe based on a character
Hello,
If I have a dataframe:
example(data.frame)
zz<-c("aa_bb","bb_cc","cc_dd","dd_ee","ee_ff","ff_gg","gg_hh","ii_jj","jj_kk","kk_ll")
ddd <- cbind(dd, group = zz)
and I want to divide the column named group by the "_", how would I do this?
so instead of the first row being
x