nicchr / timeplyr Goto Github PK
View Code? Open in Web Editor NEWFast tidy functions for date manipulation.
License: GNU General Public License v2.0
Fast tidy functions for date manipulation.
License: GNU General Public License v2.0
I have a dataframe df
with following values:
sample date_time hsign
1 1 2008-08-25 01:00:00 0.8899
2 1 2008-08-25 02:00:00 1.0260
3 1 2008-08-25 03:00:00 1.0930
4 1 2008-08-25 04:00:00 1.1310
5 1 2008-08-25 05:00:00 1.1540
6 1 2008-08-25 06:00:00 1.1700
7 1 2008-08-25 07:00:00 1.1830
8 1 2008-08-25 08:00:00 1.1940
9 1 2008-08-25 09:00:00 1.2050
10 1 2008-08-25 10:00:00 1.2060
11 1 2008-08-25 11:00:00 1.2010
12 1 2008-08-25 12:00:00 1.1880
13 1 2008-08-25 13:00:00 1.1780
14 1 2008-08-25 14:00:00 1.1650
15 1 2008-08-25 15:00:00 1.1560
16 1 2008-08-25 16:00:00 1.1510
17 1 2008-08-25 17:00:00 1.1480
18 1 2008-08-25 18:00:00 1.1470
19 1 2008-08-25 19:00:00 1.1500
20 1 2008-08-25 20:00:00 1.1520
21 1 2008-08-25 21:00:00 1.1550
22 1 2008-08-25 22:00:00 1.1580
23 1 2008-08-25 23:00:00 1.1620
24 1 <NA> 1.1660
25 1 2008-08-26 01:00:00 1.1700
26 1 2008-08-26 02:00:00 1.1760
27 1 2008-08-26 03:00:00 1.1820
28 1 2008-08-26 04:00:00 1.1830
29 1 2008-08-26 05:00:00 1.1870
30 1 2008-08-26 06:00:00 1.1980
I want to fill in the missing time value for row 24 using the following code:
df <- time_complete(df, date_time, time_by = "hour")
However, time_complete()
removes the entire row!
sample date_time hsign
1 1 2008-08-25 01:00:00 0.8899
2 1 2008-08-25 02:00:00 1.0260
3 1 2008-08-25 03:00:00 1.0930
4 1 2008-08-25 04:00:00 1.1310
5 1 2008-08-25 05:00:00 1.1540
6 1 2008-08-25 06:00:00 1.1700
7 1 2008-08-25 07:00:00 1.1830
8 1 2008-08-25 08:00:00 1.1940
9 1 2008-08-25 09:00:00 1.2050
10 1 2008-08-25 10:00:00 1.2060
11 1 2008-08-25 11:00:00 1.2010
12 1 2008-08-25 12:00:00 1.1880
13 1 2008-08-25 13:00:00 1.1780
14 1 2008-08-25 14:00:00 1.1650
15 1 2008-08-25 15:00:00 1.1560
16 1 2008-08-25 16:00:00 1.1510
17 1 2008-08-25 17:00:00 1.1480
18 1 2008-08-25 18:00:00 1.1470
19 1 2008-08-25 19:00:00 1.1500
20 1 2008-08-25 20:00:00 1.1520
21 1 2008-08-25 21:00:00 1.1550
22 1 2008-08-25 22:00:00 1.1580
23 1 2008-08-25 23:00:00 1.1620
24 1 2008-08-26 01:00:00 1.1700
25 1 2008-08-26 02:00:00 1.1760
26 1 2008-08-26 03:00:00 1.1820
27 1 2008-08-26 04:00:00 1.1830
28 1 2008-08-26 05:00:00 1.1870
29 1 2008-08-26 06:00:00 1.1980
30 1 2008-08-26 07:00:00 1.2180
I got a build failure with this version:
/opt/local/bin/g++-mp-13 -std=gnu++17 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/cpp11/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include -fPIC -pipe -Os -arch ppc -c utils.cpp -o utils.o
/opt/local/bin/g++-mp-13 -std=gnu++17 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/cpp11/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include -fPIC -pipe -Os -arch ppc -c which.cpp -o which.o
which.cpp: In function 'SEXPREC* cpp_which_(SEXP, bool)':
which.cpp:12:22: error: 'R_SHORT_LEN_MAX' was not declared in this scope
12 | bool is_long = n > R_SHORT_LEN_MAX;
| ^~~~~~~~~~~~~~~
make: *** [which.o] Error 1
ERROR: compilation failed for package ‘timeplyr’
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.