Forum: help


RE: Calculate time series data over specific range [ Reply ] By: Steven Powell on 2021-02-25 14:30 | [forum:48768] |
Hi, Thanks for this thread. I have followed the instruction and examples however am getting the following error message. > library("RHRV") > source("CreateTimeAnalysisByEpisodes.R") Error in file(filename, "r", encoding = encoding) : cannot open the connection In addition: Warning message: In file(filename, "r", encoding = encoding) : cannot open file 'CreateTimeAnalysisByEpisodes.R': No such file or directory Have you any guidance on this or has the method for analysing time series data over specific ranges changed? Thanks, Steve |
RE: Calculate time series data over specific range [ Reply ] By: Audrey Lim on 2014-10-23 15:00 | [forum:41573] |
Dear Constantino Antonio and Scott Maw, Yes, I think I loaded the file wrongly. Sorry for the false alarm; thank you! Audrey |
RE: Calculate time series data over specific range [ Reply ] By: Scott Maw on 2014-10-23 14:38 | [forum:41572] |
Hi Audrey, Are you first loading the function into R prior to running the code? As Constantino pointed out, the function isn't yet included in the RHRV package so it will need to be loaded separately. I did this and it seems to be working well. Thanks Constantino for sending the function and the working examples! |
RE: Calculate time series data over specific range [ Reply ] By: Constantino Antonio on 2014-10-23 14:35 | [forum:41571] |
Dear Audrey Lim, Did you "source" the file after loading RHRV? > library(RHRV) > source("CreateTimeAnalysisByEpisodes.R") Tell us if this works. Kind Regards |
RE: Calculate time series data over specific range [ Reply ] By: Audrey Lim on 2014-10-23 13:50 | [forum:41570] |
Dear Constantino Antonio, Thank you so much for loading the examples! However, I have tried out the "CreateTimeAnalysisByEpisodes" function and I get the error message "## Error in eval(expr, envir, enclos): could not find function "CreateTimeAnalysisByEpisodes"" Might there be another way around it? Thank you! Audrey Lim |
RE: Calculate time series data over specific range [ Reply ] By: Constantino Antonio on 2014-10-22 08:57 | [forum:41563]![]() |
Dear Scott Maw, Here is the example file (I couldn't upload it in the previous message) Kind regards |
RE: Calculate time series data over specific range [ Reply ] By: Constantino Antonio on 2014-10-22 08:45 | [forum:41562]![]() |
Dear Scott Maw, It's me who should apologize... I thought that the functionality for running the time analysis by episodes was published in the stable version but it is not. Please, find the function CreateTimeAnalysisByEpisodes attached. I've also attached some examples of this function, but its use is quite simple (it uses the same parameters as the CreateTimeAnalysis function). Please note it is still beta and it has not been tested as others functions. Sorry again! Kind Regards |
RE: Calculate time series data over specific range [ Reply ] By: Scott Maw on 2014-10-21 15:08 | [forum:41556] |
Okay, that makes more sense. So I've created the episode fine using the AddEpisodes function. But then how do I run the time series analysis on just that episode? When I run the following line of code, it still is calculating over the entire set of data: hrv.data = CreateTimeAnalysis(hrv.data,size = 300, interval = 7.8125) Thanks for your help. Sorry I'm so slow at figuring this out ! |
RE: Calculate time series data over specific range [ Reply ] By: Constantino Antonio on 2014-10-21 08:05 | [forum:41554] |
Dear Scott, It seems that you are using the LoadEpisodesAscii function in order to load the episode that you previously created with the AddEpisodes function. If that is the case, there is no need to use the LoadEpisodesAscii in order to load that episode. The LoadEpisodesAscii function is just another way of adding episodes. When using the LoadEpisodesAscii function, the episodes should have been stored in an ascii file. If you are using the LoadEpisodesAscii function in order to load different episodes, maybe the problem is the "+" symbol... If you had manually add it, just remove it (In the tutorial pdf, the "+" symbols that appear have been added by the R console, there is no need to type them). If that doesn't work, could you please send us the "annotationsFile.txt" file? Kind Regards! |
RE: Calculate time series data over specific range [ Reply ] By: Scott Maw on 2014-10-21 04:23 | [forum:41553]![]() |
Thanks, I am able to add an episode, but can't figure out the LoadEpisodes function. I've attached the file I am working from (HRVtest.hrm) And here is my code: library(RHRV) hrv.data = CreateHRVData() hrv.data = SetVerbose(hrv.data, TRUE ) hrv.data = LoadBeatRR(hrv.data, "HRVtest.hrm", RecordPath = "desktop", scale=0.001) plot(hrv.data$Beat$Time) hrv.data = BuildNIHR(hrv.data) PlotNIHR(hrv.data) #MANUAL FILTERING hrv.data = EditNIHR(hrv.data) ## ADD EPISODES hrv.data = AddEpisodes(hrv.data, InitTimes = c(100),Tags = c("Supine"),Durations = c(300),Values=c(0)) hrv.data = InterpolateNIHR (hrv.data, freqhr = 4) PlotHR(hrv.data, Tag=c("Supine")) hrv.data = CreateHRVData( ) hrv.data = LoadBeatRR(hrv.data,"HRVtest.hrm","desktop") hrv.data = SetVerbose(hrv.data,TRUE) hrv.data = LoadEpisodesAscii(hrv.data,Tag = c("Supine"),InitTime="0:0:0",+ FileName="desktop/annotationsFile.txt") Everything works fine until I try to LoadEpisodesAscii at which point, I am getting this error: Error: unexpected '=' in: "hrv.data = LoadEpisodesAscii(hrv.data,Tag = c("Supine"),InitTime="0:0:0",+ FileName=" So, I must be doing something wrong when trying to load the episode that I created. Any help would be much appreciated. Thanks! |
RE: Calculate time series data over specific range [ Reply ] By: Constantino Antonio on 2014-10-20 16:19 | [forum:41551] |
Dear Scott Maw, You can create an "episode" marking the interval in which you are interested in (In RHRV, we call episode to a specific interval of the RR time series with pathophysiological interest). Have a look to section 5.3 (Performing analysis in dierent intervals of a recording) in our tutorial: http://rhrv.r-forge.r-project.org/tutorial/tutorial.pdf We hope it helps! Kind regards |
Calculate time series data over specific range [ Reply ] By: Scott Maw on 2014-10-17 21:09 | [forum:41545] |
I'm having trouble trying to figure out how to analyze a specific segment of a data set for time series (i.e. rMSSD). For example, I use HRV for monitoring athlete fatigue using a 10 minute data collection. I analyze 5 minutes of this data but need to be able to pick the 5 minutes that I want to look at. Any thoughts? |