Recently I received a surprising email from a scholar that I haven’t met before. He told me that he came across my blog about aggregating minutely data into hourly data when he was trying to calculate the daily mean from a different time interval (e.g., from 09:00 am to 08:00 am at the following day).
At first, I was so surprised, as I thought that this blog could not be indexed by Google. Then, I felt a little bit embarrassed, because I didn’t write the posts very carefully, so the contents must have lots of grammar errors, and might not make sense. However, I felt happy in the end, as it was wonderful to know that my notes had enlightened others who faced the same problem. So I want to express my gratitude to all who have read my posts and borne my poor writing. I also hope to receive opinions from every reader 🙂
In this post, I would like to share my idea with you on how to calculate daily mean with a different time interval (e.g., from 9:00 am to 8:00 at the other day). I think that the quickest way is to calculate the mean of each column by every 24 rows in the data frame. For example, here is the initial data sheet:
Fig. 1 Initial data example
In order to make the R code simple, I delete the first two rows, so that the record started from 9:00 am. Now, let’s put the data frame into R as data1.
Fig. 2 Data arrangement in R.
Then, let’s build a simple function to calculate the mean of every 24 rows.The code was taken from Vlo’s answer from the following website: https://stackoverflow.com/questions/30359427/calculate-the-mean-of-every-13-rows-in-data-frame. If you would like to calculate the sum instead of the mean, please just adjust the “FUN= ” commend.
n.colmeans = function(df, n = 24){
aggregate(x = df,
by = list(gl(ceiling(nrow(df)/n), n)[1:nrow(df)]),
FUN = mean)
} ### because I have 12 column in the data frame, so n > 12. This function will calculate the average of every 24 rows. For example, the result comes from row 1 to row 24, then from row 25 to row 49, etc.)
After we run the above codes, we input the following code:
data2<- n.colmeans(data1, 24) ### this is used to apply the above function to calculate our own dataset.
The daily means of every column in the data2 were calculated with the time interval from 9:00 am to 8:00 at the other day. You can export the result by using the following code:
data2 <-write.xlsx( )
Finally we got what we want. Yay! However, it is note that If your data have missing rows, then this method is not applicable.
There are definitely other ways to aggregate the data, but the codes in this blog, in my opinion, is the most simple ones. If you have different opinions, or you’d like to share your codes, please feel free to leave your comments.
Thank you for reading it! 🙂
Hey there! I know this is kind of off topic but I was wondering which blog platform are you using for this site? I’m getting sick and tired of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be awesome if you could point me in the direction of a good platform.|
Hey Twanna! Thanks for reading the post!
I am sorry that you had issues with hackers. I uses WordPress and it works fine 😉
Hello.This post was really interesting, particularly because I was looking for thoughts on this subject last Monday.
Hey thanks for reading it!
Hi there would you mind letting me know which hosting company you’re using? I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot quicker then most. Can you suggest a good internet hosting provider at a reasonable price? Cheers, I appreciate it!
Hey Rolande! Thanks for reading the post!
I was not sure if you asked the blog platform. I am using WordPress.
This is a topic that is close to my heart…
Take care! Exactly where are your contact details though?
Hi Francisca,
Thanks for reading the post. My contact details is here: https://blogs.ubc.ca/yiwang28/contact-information-2/.
Aw, this was an exceptionally good post. Spending some time and actual effort to produce a good article… but what can I say… I
hesitate a whole lot and never seem to get anything done.
Hey there! Would you mind if I share your blog with my twitter
group? There’s a lot of people that I think would really enjoy your content.
Please let me know. Thank you
I every time emailed this weblog post page to all my contacts, for the reason that if like to read it
next my contacts will too.
Its such as you learn my mind! You appear to know a lot approximately this, such as
you wrote the ebook in it or something. I feel that you could
do with a few % to pressure the message house
a little bit, however instead of that, this is fantastic blog.
An excellent read. I will certainly be back.
Simply wish to say your article is as surprising.
The clarity for your publish is just great and that i could suppose you’re knowledgeable on this subject.
Fine together with your permission let me to take hold of your feed to keep up to date with drawing close post.
Thank you a million and please keep up the gratifying work.
Hey There. I found your blog using msn. This is an extremely well written article.
I will make sure to bookmark it and come back to read
more of your useful information. Thanks for the post. I will certainly
comeback.
I am regular visitor, how are you everybody? This post posted at this
site is truly good.
This website was… how do you say it? Relevant!! Finally I’ve found something which helped me.
Cheers!
Glad to know that! Thank you for browsing my blog!
Hello There. I found your weblog using msn. This is a very smartly written article.
I will be sure to bookmark it and come back to learn extra of your helpful information. Thanks for the post.
I’ll certainly return.
Thank you Ferne!
Link exchange is nothing else however it is simply placing the other person’s web site
link on your page at proper place and other person will also do similar for you.
Thank you for your suggestion!
You could certainly see your expertise within the work you write.
The arena hopes for more passionate writers such as you who aren’t
afraid to mention how they believe. All the time follow your heart.
Thank you!
When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a
comment is added I get four e-mails with the same comment.
Is there any way you can remove me from that service?
Cheers!
I don’t know how to fix this problem. Sorry for the bothering!
If you wish for to obtain a good deal from this paragraph then you have to apply such methods to your won weblog.
Hello, Neat post. There is an issue together with your website in web explorer, may
check this? IE still is the market chief and
a big portion of people will pass over your excellent writing because of
this problem.
Thanks for pointing this out! To be honest, I don’t know how to fix it. But anyway I hope you enjoyed my posts 🙂
I am really impressed with your writing skills as well as
with the layout on your blog. Is this a paid theme or did you
modify it yourself? Anyway keep up the nice quality writing, it is rare to see a nice blog like this one today.
Thank you! It is a free theme and I just modified it by myself.
You actually make it seem so easy with your presentation but I find this
matter to be really something that I think I would never understand.
It seems too complex and extremely broad for me.
I’m looking forward for your next post, I will try to get the hang of
it!
Thank you!
An outstanding share! I’ve just forwarded this onto a coworker
who had been conducting a little research on this.
And he in fact ordered me lunch simply because I discovered
it for him… lol. So let me reword this….
Thank YOU for the meal!! But yeah, thanx for spending time to discuss this topic here on your internet site.
Thank you!
Excellent blog here! Also your site loads up fast!
What web host are you using? Can I get your affiliate link to
your host? I wish my web site loaded up as quickly as yours lol
Hi Jeffery, thanks for browsing my blog! I am using WordPress 🙂
It’s a pity you don’t have a donate button! I’d without a doubt donate to this brilliant blog!
I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account.
I look forward to new updates and will share this website with my Facebook group.
Chat soon!
Thank you!
I believe you have mentioned some very interesting
details, thank you for the post.
Thank you!
Hi would you mind sharing which blog platform you’re
using? I’m looking to start my own blog soon but I’m having a
hard time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your layout seems different then most blogs and I’m looking for something
completely unique. P.S My apologies for being off-topic but I had to ask!
Hi I am using WordPress 🙂
It’s hard to find knowledgeable people about this subject, however, you seem
like you know what you’re talking about! Thanks
Thank you!
I truly appreciate this post. I’ve been looking
everywhere for this! Thank goodness I found it on Bing.
You’ve made my day! Thanks again!
I appreciate, lead to I discovered exactly hat
I was looking for. You have ended my 4 day long hunt! God Bless you man. Have a nice day.
Bye
Thank you!
At this time it sounds like Movable Type is the best blogging platform out there right now.
(from what I’ve read) Is that what you’re using on your blog?
I visited many blogs however the audio quality
for audio songs current at this web page is truly wonderful.
I genuinely enjoy looking at on this internet site, it has good articles.
Thank you!
I think you have remarked some very interesting details, thank you for the
post.
Currently it sounds like Expression Engine iis the best blogging pltform available right
now. (from what I’ve read) Is that what you
are using on your blog?
Thanks for browsing my blog! I am using WordPress.
I have read some excellent stuff here. Certainly worth bookmarking
for revisiting. I wonder how a lot effort you place
to make such a fantastic informative site.
Hi, I desire to subscribe for this website to take newest updates, so where can i do it please help out.
Hi Trina, thank you for reading my posts! You may get updates of my blogs through RSS. 🙂
Excellent goods from you, man. I have have in mind your stuff
prior to and you’re just too great. I really like what you’ve got right here, really like what you’re stating and the way
in which wherein you assert it. You make it enjoyable and you still care
for to keep it smart. I cant wait to learn far more from you.
This is really a great web site.
Fine way of telling, and good article to obtain data about my presentation subject, which i am going to present in university.
Thank you Rosaline! Good luck on your presentation!
My partner and I absolutely love your blog and find a lot of your post’s to be what precisely I’m
looking for. Would you offer guest writers to write content for you?
I wouldn’t mind creating a post or elaborating on many of
the subjects you write in relation to here. Again, awesome site!
Thank you Spencer!
I think this is among the most vital information for me.
And i am glad reading your article. But wanna remark on some general things, The site style is great,
the articles is really excellent : D. Good job, cheers
Good site you have got here.. It’s difficult to find excellent writing like yours nowadays.
I honestly appreciate individuals like you! Take care!!
Thank you!
Hi there, just wanted to tell you, I liked this
post. It was inspiring. Keep on posting!
You actually make it seem so easy with your presentation but I find this topic
to be really something that I think I would never understand.
It seems too complex and very broad for me. I’m looking forward for your next post, I’ll try to get the hang of
it!
Hi, constantly i used to check web site posts here in the early hours in the
morning, for the reason that i like to learn more and more.
Thank you Myrna!
This paragraph offers clear idea designed for the new users of blogging, that genuinely
how to do blogging.
Thank you Bridgette!
I don’t even know the way I ended up here, but I believed
this publish was once great. I don’t realize who you are but certainly you’re going to a well-known blogger if you happen to
are not already. Cheers!
Hi there very cool web site!! Guy .. Excellent ..
Amazing .. I will bookmark your site and take the feeds also?
I am happy to seek out numerous helpful info here within the publish, we’d like develop more strategies on this regard,
thanks for sharing. . . . . .
Thank you Jonathan!
Hi i am kavin, its my first time to commenting anywhere, when i read this article
i thought i could also create comment due to this good
post.
Thank you Kavin!
Valuable info. Fortunate me I discovered your website
by chance, and I am shocked why this twist of fate didn’t happened
earlier! I bookmarked it.
Thank you!
For hottest news you have to pay a visit internet and on web I found this website as a finest
site for latest updates.
Thank you!
I do not even know the way I ended up right here, however I thought this post was good.
I don’t recognize who you might be however definitely you are going to a well-known blogger if you happen to aren’t already.
Cheers!
Thank you for encouraging me!
I got this web page from my friend who informed me
regarding this website and now this time I am browsing
this site and reading very informative content here.
Thank you!
Pretty! This has been a really wonderful article.
Thank you for supplying this info.
Thank you Susana!
Greetings from Florida! I’m bored to death at work so I
decided to browse your blog on my iphone during lunch break.
I really like the info you provide here and can’t
wait to take a look when I get home. I’m surprised at how quick your blog loaded on my phone ..
I’m not even using WIFI, just 3G .. Anyways,
very good site!
Thank you Teri!
Its like you read my mind! You appear to know so much about this,
like you wrote the book in it or something. I think that you
can do with a few pics to drive the message home a bit, but other
than that, this is wonderful blog. A great read. I will certainly be
back.
Hi Joanne, thank you for your suggestion! I will improve my posts as you suggested 🙂
Howdy! This blog post couldn’t be written much better!
Looking at this article reminds me of my previous roommate!
He continually kept preaching about this. I most certainly will send this post
to him. Pretty sure he’s going to have a great read.
Many thanks for sharing!
Thank you Valeria!
Hi friends, its impressive piece of writing
regarding tutoringand completely defined, keep it up all the time.
Thank you Mark!
Hi there mates, fastidious article and pleasant urging commented here,
I am actually enjoying by these.
Thank you Jamie!
Do you mind if I quote a few of your posts as long as I provide credit and sources back to your website?
My blog is in the exact same area of interest as yours and my visitors
would genuinely benefit from a lot of the information you provide here.
Please let me know if this alright with you. Many thanks!
Hi Alfred, thank you for reading my post! Please feel free to quote them 🙂
Thanks for any other informative web site. Where else could I get that
kind of information written in such an ideal method?
I have a project that I am simply now operating on,
and I’ve been on the glance out for such information.
Hi Franziska, thanks for reading my post! I like to visit stack overflow to learn statistical methods, and visit some websites of peer-reviewed journals related to my study to know the advance knowledge of the research. I will keep post my reflections time to time 🙂
Definitely imagine that which you stated. Your favourite justification seemed to be at the internet the simplest thing to bear in mind of.
I say to you, I certainly get annoyed at the same time as other folks consider worries that they just
don’t recognise about. You managed to hit the nail upon the highest and also defined
out the whole thing with no need side effect , folks could take a signal.
Will probably be back to get more. Thank you
Thank you!
With havin so much content and articles do you ever run into any issues of
plagorism or copyright infringement? My site has
a lot of exclusive content I’ve either created myself or outsourced but it looks like a lot of it is popping it up all over
the web without my authorization. Do you know any solutions to help reduce content from being stolen? I’d definitely appreciate it.
Hi thank you for browsing my blog! I didn’t run into this issue, but I hope that people who would like to share your posts in their website will gain your approval in advance 🙂
I do believe all the concepts you have introduced for your post.
They are really convincing and can certainly work. Nonetheless, the posts
are very brief for beginners. May you please prolong them a bit from next time?
Thank you for the post.
Thank you for your suggestion! I will be more detailed and clear in my following posts 🙂
I am regular reader, how are you everybody? This article
posted at this website is in fact fastidious.
Thank you! I will post more and I hope you will like them 🙂
Hey There. I discovered your weblog the usage of msn. That is a very neatly written article.
I will make sure to bookmark it and come back to read extra of your helpful info.
Thanks for the post. I will definitely comeback.
Thank you!
Have you ever thought about writing an e-book or guest
authoring on other sites? I have a blog centered on the same ideas you discuss and would love to have you share some
stories/information. I know my viewers would appreciate your work.
If you are even remotely interested, feel free to shoot me an e mail.
Thank you for reading my post and inviting me to share my story in your blog! I’d love to do that.
I blog quite often and I genuinely appreciate your content.
This great article has truly peaked my interest.
I will bookmark your website and keep checking for new information about once a week.
I subscribed to your RSS feed too.
Thank you very much for subscribing my blog!
Having read this I thought it was really informative. I appreciate you taking
the time and energy to put this content together. I once again find myself personally spending way too much time both reading and
leaving comments. But so what, it was still worthwhile!
Thank you!
Hello, its good post about media print, we all be familiar with media is a fantastic source of data.
Thanks a bunch for sharing this with all people you really realize what
you are talking approximately! Bookmarked. Please also consult with my website =).
We could have a link trade arrangement between us
How would one do this if they do have missing rows.
It’s hard to find well-informed people in this particular
topic, however, you seem like you know what you’re talking about!
Thanks
Very good written story. It will be beneficial to everyone who employess it, as
well as yours truly :). Keep doing what you are doing
– i will definitely read more posts.
As I website possessor I believe the subject material here is real
excellent, thanks for your efforts.
Quality posts is the secret to interest the users to pay a quick visit the web site, that’s what this web site is providing.
A person essentially assist to create severely posts
I might state. That is the first time I frequented your website page
and to the point? I surprised together with the research you made to
create this actual post incredible. Excellent task!
Also visit my webpage – PaulHStaiger
Nice blog here! Also your website loads up very fast! What host are you using?
Can I get your affiliate link to your host? I wish my site loaded up as quickly as yours lol
There’s definately a lot to learn about this topic. I like all of the points you made.
Right here is the right website for anybody who would like to understand this topic.
You know so much its almost tough to argue with you
(not that I actually would want to…HaHa). You definitely put a brand new spin on a topic that has been written about for decades.
Excellent stuff, just wonderful!
Thanks for the auspicious writeup. It if truth be told was once a
amusement account it. Glance complicated to far brought agreeable from you!
By the way, how can we keep in touch?
We would like to thank you yet again for the gorgeous ideas you offered
Jesse when preparing her post-graduate research plus, most importantly, regarding providing
the many ideas in one blog post. If we had known of your web-site a year
ago, we might have been saved the useless measures we were
employing. Thanks to you.
Hi there everybody, here every person is sharing these know-how, so
it’s good to read this blog, and I used to
pay a visit this website every day.
It’s perfect time to make some plans for the future and it’s time to be happy.
I’ve read this post and if I could I want to suggest
you few interesting things or advice. Perhaps you could write next articles referring to this article.
I wish to read more things about it!
I pay a visit everyday a few sites and sites to read posts, except
this website offers quality based content.
Its good as your other posts :D, thanks for putting up.
Great delivery. Outstanding arguments. Keep up the good effort.
Hi everybody, here every person is sharing these kinds
of experience, thus it’s nice to read this website, and I used
to go to see this website all the time.
Hi there, I want to subscribe for this web site to take most up-to-date updates, so where
can i do it please help out.
I do not even understand how I stopped up right here, but I thought this post was good.
I don’t know who you are however definitely you’re going to a famous blogger
if you aren’t already. Cheers!
If some one wants expert view on the topic of running a
blog afterward i recommend him/her to pay a quick visit this blog, Keep up the fastidious work.
I absolutely love your blog.. Very nice colors & theme.
Did you create this amazing site yourself? Please reply back as I’m wanting to create my own website
and want to find out where you got this from or
just what the theme is called. Appreciate it!
I go to see day-to-day some web pages and information sites to read
posts, except this website provides feature based writing.
Thank you for another fantastic article. Where else
could anyone get that type of information in such a perfect method of writing?
I’ve a presentation next week, and I’m on the search for such information.
Lovely just what I was searching for. Thanks to the author for taking his clock time on this one.
I’m not sure where you are getting your information, but
good topic. I needs to spend some time learning more or understanding more.
Thanks for excellent info I was looking for this info for my mission.
Hello there, I found your web site via Google even as searching for a comparable matter, your web site
came up, it appears great. I have bookmarked it in my google bookmarks.
Hi there, simply became aware of your weblog through Google,
and found that it’s truly informative. I’m going to
watch out for brussels. I will be grateful when you proceed this in future.
Many other folks shall be benefited from your writing.
Cheers!
Hello, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam feedback?
If so how do you stop it, any plugin or anything you can suggest?
I get so much lately it’s driving me mad so any assistance is
very much appreciated.
Hi there, I wish for to subscribe for this weblog to obtain newest updates, therefore where can i do it please help.
Really clean website, appreciate it for this post.
Hey! I was able to have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s a novice to me.
Anyhow, I’m definitely happy I came across it and I’ll be
book-marking and checking back often!
My webpage – ColeDSideman
Thanks for posting this, it was unbelievably informative and helped me a lot. Well-written blog post.
I think youve created some actually interesting points. Not also many people would actually think about this the way you just did. 파워볼
Hi Yi
I am happy that you have shared the question I raised a year ago. Indeed the function you wrote helped me.
However, I found it very challenging to aggregate rainfall as sum using the function.
Is there a way I can select this rainfall column and aggregate is as sum of the same time period 900am 800am of the other day?
thanks for sharing.
TURBO1.CO
injectable ed medications https://alprostadildrugs.com/ does topical
Very nice post. I just stumbled upon your blog and wished to say that I’ve really enjoyed surfing around your blog posts.
After all I will be subscribing to your feed and I hope you write again soon!
This is an informative and well-researched article, thank you for sharing.seo malaysia
Your writing is both informative and entertaining, which is a rare and valuable combination.best onlinecasino malaysia
Your article provided a fresh perspective on a topic that I thought I knew a lot about.malaysia onlinecasino
Drift Boss is a famous drifting game. In the game, you will have the opportunity to control your car on endless roads full of difficult turns and collisions. The game sounds simple but it takes a lot of practice to be able to drift well around corners. Join the game now to prove that you are the best racer and score the most points.
SMM Panel One is your one-stop solution for skyrocketing your social media presence and success. With our cutting-edge Social Media Marketing (SMM) panel, you can harness the power of various platforms to elevate your brand, engage your audience, and drive unprecedented growth. From increasing followers, likes, and comments to generating buzz around your content, our platform offers a seamless and efficient way to conquer the digital landscape. Boost your social media game with SMM Panel One and witness the magic of organic reach and genuine interactions like never before!
You do a great job, keep doing thank you for good work./
The article https://www.metrotimes.com/weed/the-best-cbd-gummies-for-sleep-overview-2024-36641046 reviews the top CBD Gummies for Sleep to hand this year. It highlights four standout products, emphasizing their potency, flavor, and overall consumer satisfaction. The novelist effectively balances complete descriptions with user testimonials, giving readers a comprehensive reading of each option. The incorporation of dosage guidelines and refuge tips over enhances its value. This well-researched fraction is an a-one resource representing exploring CBD gummies for speel in 2024.