Displaying 12 results from an estimated 12 matches for "year_to".
2017 Nov 26
3
dplyr - add/expand rows
dplyr may have something for this, but in base R I think the following does
what you want. I've shortened the name of your data set to 'd'.
i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Sat, Nov 25, 2017 at 11:18 AM, Hutchinson, David (EC) <
david.hutchinson at canada.ca> wrote:
> I have a returned...
2017 Nov 26
0
dplyr - add/expand rows
...t, Nov 25, 2017 at 4:49 PM, William Dunlap via R-help <
r-help at r-project.org> wrote:
> dplyr may have something for this, but in base R I think the following does
> what you want. I've shortened the name of your data set to 'd'.
>
> i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
> j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
> transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Sat, Nov 25, 2017 at 11:18 AM, Hutchinson, David (EC) <
> david.hutchinson a...
2017 Nov 28
1
dplyr - add/expand rows
...m Dunlap via R-help <
> r-help at r-project.org> wrote:
>
>> dplyr may have something for this, but in base R I think the following
>> does
>> what you want. I've shortened the name of your data set to 'd'.
>>
>> i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
>> j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
>> transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
>>
>>
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>>
>> On Sat, Nov 25, 2017 at 11:18 AM, Hutchinson, Dav...
2017 Nov 27
2
dplyr - add/expand rows
...m Dunlap via R-help <
> r-help at r-project.org> wrote:
>
> > dplyr may have something for this, but in base R I think the following
> does
> > what you want. I've shortened the name of your data set to 'd'.
> >
> > i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
> > j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
> > transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
> >
> >
> > Bill Dunlap
> > TIBCO Software
> > wdunlap tibco.com
> >
> > On Sat, Nov 25, 2017 at 11:18 AM, Hutchi...
2017 Nov 28
0
dplyr - add/expand rows
...>> r-help at r-project.org> wrote:
>>
>>> dplyr may have something for this, but in base R I think the following
>> does
>>> what you want. I've shortened the name of your data set to 'd'.
>>>
>>> i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
>>> j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
>>> transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
>>>
>>>
>>> Bill Dunlap
>>> TIBCO Software
>>> wdunlap tibco.com
>>>
>>> On Sat, Nov 2...
2017 Nov 28
2
dplyr - add/expand rows
...gt;>
>>> dplyr may have something for this, but in base R I think the following
>>>>
>>> does
>>>
>>>> what you want. I've shortened the name of your data set to 'd'.
>>>>
>>>> i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
>>>> j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
>>>> transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
>>>>
>>>>
>>>> Bill Dunlap
>>>> TIBCO Software
>>>> wdunlap tibco.com
>>>...
2018 Jan 19
1
Web scraping different levels of a website
...smaller chunks for
readability and because its easier to substitute some query
paramaters.
# load libs
library("rvest")
library("httr")
library("glue")
library("magrittr")
# number of studies to pull from catalogue
num_studies <- 42
year_from <- 1890
year_to <- 2017
# build up the url
url <-
glue(
"http://catalog.ihsn.org/index.php/catalog/",
"search?view=s&",
"ps={num_studies}&",
"page=1&repo=&repo_ref=&sid=&_r=&sk=&vk=&",
"from={year_from}&am...
2017 Nov 29
0
dplyr - add/expand rows
...yr may have something for this, but in base R I think the following
>>>>>
>>>> does
>>>>
>>>>> what you want. I've shortened the name of your data set to 'd'.
>>>>>
>>>>> i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
>>>>> j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
>>>>> transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
>>>>>
>>>>>
>>>>> Bill Dunlap
>>>>> TIBCO Software
>>>>> w...
2017 Nov 29
2
dplyr - add/expand rows
...r this, but in base R I think the following
>>>>>>
>>>>> does
>>>>>
>>>>>> what you want.? I've shortened the name of your data set to 'd'.
>>>>>>
>>>>>> i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
>>>>>> j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
>>>>>> transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
>>>>>>
>>>>>>
>>>>>> Bill Dunlap
>>>>>> TIBCO Softwar...
2017 Nov 29
0
dplyr - add/expand rows
...;>> following
>>>>>>>
>>>>>> does
>>>>>>
>>>>>>> what you want. I've shortened the name of your data set to 'd'.
>>>>>>>
>>>>>>> i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1)
>>>>>>> j <- sequence(d$YEAR_TO-d$YEAR_FROM+1)
>>>>>>> transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, YEAR_TO=NULL)
>>>>>>>
>>>>>>>
>>>>>>> Bill Dunlap
>>>>&g...
2017 Nov 25
0
dplyr - add/expand rows
I have a returned tibble of station operational record similar to the following:
> data.collection
# A tibble: 5 x 4
STATION_NUMBER YEAR_FROM YEAR_TO RECORD
<chr> <int> <int> <chr>
1 07EA001 1960 1960 QMS
2 07EA001 1961 1970 QMC
3 07EA001 1971 1971 QMM
4 07EA001 1972 1976 QMC
5 07EA001 1977 1983 QRC
I would like to...
2017 Nov 26
0
dplyr - add/expand rows
> On Nov 25, 2017, at 11:18 AM, Hutchinson, David (EC) <david.hutchinson at canada.ca> wrote:
>
> I have a returned tibble of station operational record similar to the following:
>
>> data.collection
> # A tibble: 5 x 4
> STATION_NUMBER YEAR_FROM YEAR_TO RECORD
> <chr> <int> <int> <chr>
> 1 07EA001 1960 1960 QMS
> 2 07EA001 1961 1970 QMC
> 3 07EA001 1971 1971 QMM
> 4 07EA001 1972 1976 QMC
> 5 07EA001 1977...