search for: hosack

Displaying 20 results from an estimated 23 matches for "hosack".

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
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
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 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
2011 Mar 09
2
Complex sampling?
R users, I am trying to generate a randomized weekday survey schedule that ensures even coverage of weekdays in the sample, where the distribution of variable DOW is random with respect to WEEK. To accomplish this I need to randomly sample without replacement two weekdays per week for each of 27 weeks (only 5 are shown). However, I need to sample from a sequence (3:7) that needs to be
2010 Apr 19
1
Week number calculation
R community, How could I extract the week number from a date vector (in class Date) such that week numbering (week 1...2...) begins (May 01) and ends (October 31) on the same specific dates each year? Thank you, Mike
2010 Mar 10
0
FW: How to assign week numbers to a time-series (additional question)
...rames. This program will be used to produce sampling schedules for many subsequent years, most of which will not begin on a Saturday. Does anyone know how this could be done? Please see the attached partial copy of my dataframe. The survey runs from May 01 to Oct 31. Thanks so much, Mike From: Hosack, Michael Sent: Friday, March 05, 2010 4:24 PM To: 'R-help at r-project.org' Subject: 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...
2010 Mar 10
0
How to assign week numbers to a time-series (duplicate message in plain text formatting)
...ames. This program will be used to produce sampling schedules for many subsequent years, most of which will not begin on a Saturday. Does anyone know how this could be done? Please see the attached partial copy of my dataframe. The survey runs from May 01 to Oct 31. Thanks so much, Mike From: Hosack, Michael Sent: Friday, March 05, 2010 4:24 PM To: 'R-help at r-project.org' Subject: 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...
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 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 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
2011 Feb 10
1
Conditional sampling
R experts, I need to sample two rows without replacement from the following data frame such that neither row contains the same 'DOW'. For example, I cannot select both a Monday morning and a Monday afternoon. I am using STRATA_NUM as an index to randomly select rows from, since this variable indexes all unique permutations of DOW, SITE, and TOD. I know how to use the sample function
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
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 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
2010 Mar 24
0
R-help ordinal regression
...incent) > ? 17. Re: help with survival package (David > Winsemius) > ? 18. Re: R-installation regarding. (Paul Hiemstra) > ? 19. Re: Embed R code in C++ (Romain Francois) > ? 20. Re: If else statements (tj) > ? 21. Re: If else statements (R Help) > ? 22. Converting date format (Hosack, Michael) > ? 23. no predict function in lme4 ? (Markus Loecher) > ? 24. Re: Converting date format (Nutter, Benjamin) > ? 25. Solutions for memory problems (packages ff, > bigmemory)? > ? ? ? (hhafner at statistik-hessen.de) > ? 26. multi-stage sampling and hierarchical models: &...
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)
2011 Feb 04
1
read.table error
R experts, I am working with a fairly large data set comprised of 563 rows by 116 columns including several different modes. I have been unable to read in the data set completely using the read.table function and the RGui (i.e. nearly half the total number of rows are missing from the data set along with the column names). The data does read in fully using Tinn-R's Rterm; however, at several