Code Monkey home page Code Monkey logo

rraven's Introduction

Rraven: connecting R and Raven sound analysis software

lifecycle Dependencies Project Status: Active The project has reached a stable, usable state and is being actively developed. Licence minimal R version packageversion Last-changedate CRAN_Status_Badge Total Downloads

warbleR logo

The Rraven package is designed to facilitate the exchange of data between R and Raven sound analysis software (Cornell Lab of Ornithology). Raven provides very powerful tools for the analysis of (animal) sounds. R can simplify the automatization of complex routines of analyses. Furthermore, R packages as warbleR, seewave and monitoR (among others) provide additional methods of analysis, working as a perfect complement for those found in Raven. Hence, bridging these applications can largely expand the bioacoustician’s toolkit.

Currently, most analyses in Raven cannot be run in the background from a command terminal. Thus, most Rraven functions are design to simplify the exchange of data between the two programs.

Install/load the package from CRAN as follows:

# From CRAN 
install.packages("Rraven")

#load package
library(Rraven)

To install the latest developmental version from github you will need the R package remotes:

# From github
remotes::install_github("maRce10/Rraven")

#load package
library(Rraven)

The package vignette provides detailed examples for each function in Rraven, including both the R code as well as the additional steps in Raven required to fully accomplished the analyses. You can pull it up as follows:

vignette("Rraven")

The animations explaining additional steps in Raven are shown in more detail on the github version of this vignette, which can be downloaded as follows (saves the file “Rraven.github.html” in your current working directory):

download.file(url = "https://raw.githubusercontent.com/maRce10/Rraven/master/gifs/Rraven.hitgub.html", 
destfile = "Rraven.hitgub.html")

The downloaded file can be opened by any internet browser.


Please cite Rraven as follows:

Araya-Salas. (2020), Rraven: connecting R and Raven bioacoustic software. R package version 1.0.9.

rraven's People

Contributors

danwoodrich avatar maelle avatar marce10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rraven's Issues

Problems with empty selection tables

Hi maRce10!

I'm having problems with the function imp_raven. It turns out that when I try to import my selection tables from Raven to R, if I have an empty selection table, my code doesn't work. And I also don't know if I can delete that selection table directly from R, because I have too many selection tables that I want to analyze with your super awesome warbleR package !!!

Thanks !

imp_raven

When running the example code (copy/paste) listed on https://marce10.github.io/2017/11/30/Rraven-_Connecting_R_and_Raven_Sound_Analysis_Software.html the following error occurs:

rvn.dat <- imp_raven(all.data = TRUE)
Error in rbind(deparse.level, ...) :
numbers of columns of arguments do not match

rvn.dat <- imp_raven(all.data = TRUE, waveform = TRUE)
Error in rbind(deparse.level, ...) :
numbers of columns of arguments do not match

rvn.dat <- imp_raven(sound.file.col = "End.File", all.data = FALSE, freq.cols = TRUE)
Error in FUN(X[[i]], ...) :
'End.File' column provided in 'sound.file.col' not found (make sure no other '.txt' files are found in that directory

With my own data (which for simplicity at this moment is one folder with 1 wave file of a track and 1 selection table) rvn.dat <- imp_raven(all.data = TRUE) works succesfully.

However, rvn.dat <- imp_raven(sound.file.col = "End.File", all.data=FALSE, freq.cols = TRUE) returns the same error as with the example code:

Error in FUN(X[[i]], ...) :
'End.File' column provided in 'sound.file.col' not found (make sure no other '.txt' files are found in that directory

It seems to be something with all.data = FALSE. If I also set all.data to TRUE it works in every case (except for with the example code which does not work and gives the error in Rbind output).

I would appreciate any insight into this error and to know if it's perhaps something I am doing wrong, or something wrong with the imp_raven function. Thank you very much.

Unable to open .wav files saved in r with Raven

I'm looking for advice on saving wave files so they are viewable in Raven following manipulation in R.

I have code that opens a portion of a long .wav file (based on a specific/referred selection), then saves just that portion of the wave file. I have tried seewav and tuneR, The full input file and the clipped file look the same:
Wave Object - R object before saving
Number of Samples: 73200
Duration (seconds): 3.05
Samplingrate (Hertz): 24000
Channels (Mono/Stereo): Stereo
PCM (integer format): TRUE
Bit (8/16/24/32/64): 16

But when I reopen the saved file it appears one channel has been dropped when saving.

Wave Object - reopened R object after saving
Number of Samples: 73200
Duration (seconds): 3.05
Samplingrate (Hertz): 24000
Channels (Mono/Stereo): Mono
PCM (integer format): TRUE
Bit (8/16/24/32/64): 16
all of the saved files can be played using audio programs (e.g. windows media player, but none can be opened with Raven Pro 1.15.

Do you have any advice?

selection tables produced by exp_raven have wrong Begin File and Begin Path when opened in RavenPro1.5

Hello, I am trying to use exp_raven to create a selection table that will open in RavenPro 1.5.

I used exp_raven to create a .txt sound selection table. It is one sound selection table file that contains selections from multiple call files. When I open the sound selection table in a text editor, all the information is correct. There are 37 different sound files in Begin File and Begin Path columns, each with between 1 and 12 selections.

sound_selection_table_pop410.txt

When I open this sound selection table in RavenPro 1.5, it seems to correctly sequence the sound files and apply the selections. The selection table has 388 rows, just as it does in the text editor. However the information in the Begin File and Begin Path columns is different. Only the first 11 of the sound files appear in those columns , and they are listed for more than their 12 selections. I saved the selection table out of Raven:

sound_selection_table_pop410_postraven.txt

Weirdly, I think it is actually using the correct sound files, and just listing different ones. When I check the peak frequency of the last row (row 388) in the selection table, it is the peak frequency of the last selection of the 37th sound file (which I opened and checked by entering start and end times by hand). Whereas the sound selection table as viewed in Raven (sound_selection_table_pop410_postraven.txt) lists Row 388 as the final selection of the 11th sound file (male11_SB.WAV).

Finally, I don't believe this issue is unique to my particular selection table. When I use the example files in Rraven, and I open the "Phaethornis multiple sound files.txt" selection table in RavenPro 1.5, the
Begin File and Begin Path as viewed in Raven also differ from the contents of the selection table created by exp_raven:

Phaethornis multiple sound files.txt
Phaethornis multiple sound files_postRaven.txt

I'd appreciate any thoughts about what might be hapening here.

By the way, I love the Rraven package, it's really useful. Audacity exports labels as .txt files with start and end times, so with a little custom programming I'm using Rraven to move between Audacity and Raven. It's making my life a lot easier!

Default text file name temp.bcv.txt is not compatible with parallelization

Hi Marcelo,

It appears that the generated temp.bcv.txt file does not work with parallelization, which surprisingly (and to my delight) works great otherwise. Raven does not seem to use CPU cores very efficiently on the detectors so it is a big performance boost to use parallelization. My parallelization structure I am using, which apparently has good compatibility with the Raven API is foreach.

Adding a unique variable to the name of the 'temp.bcv.txt' makes parallelization run smoothly- I run a series of detectors in my script so I just chose the detector name variable for my script. The reason why I didn't make a branch is because I imagine there is better practice on how to guarantee a unique name for a wider variety of use cases, which I'll leave up to you if you are interested in implementing this functionality.

Cheers,
Dan

Unable to use raven_batch_detec with error of (file, "rt")

Hi Marcelo
I have some problem with function raven_batch_detec(). There's an error occur:

Error in file (file, "rt"): cannot open the connection 
In addition: 
Warning message: In file (file, "rt"):   cannot open file 'temp.bcv.txt': No such file or directory

it seems there is something wrong of source code running on Win 11 x64, but I haven't tried on Linux.
Do you have any solution or advice?

Thanks

Problem with RCurl

Hi there, novice here.

This may be a question not related to Rraven, but when I try to install the package from github, I get the following error. Any idea of what the problem could be? Running R 3.6.3 Rtools 3.5 (before 4.0) on RGui

devtools::install_github("maRce10/Rraven")
Downloading GitHub repo maRce10/Rraven@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: RCurl (1.98-1.1 -> 1.98-1.2) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
1
RCurl (1.98-1.1 -> 1.98-1.2) [CRAN]
Installing 1 packages: RCurl
Installing package into ‘C:/Users/axeld/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
RCurl 1.98-1.1 1.98-1.2 TRUE

installing the source package ‘RCurl’

trying URL 'https://cloud.r-project.org/src/contrib/RCurl_1.98-1.2.tar.gz'
Content type 'application/x-gzip' length 699583 bytes (683 KB)
downloaded 683 KB

  • installing source package 'RCurl' ...
    ** package 'RCurl' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs

*** arch - i386
c:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA1/R/R-361.3/include" -DNDEBUG -I/include -DHAVE_LIBIDN_FIELD=1 -DHAVE_CURLOPT_URL=1 -DHAVE_CURLINFO_EFFECTIVE_URL=1 -DHAVE_CURLINFO_RESPONSE_CODE=1 -DHAVE_CURLINFO_TOTAL_TIME=1 -DHAVE_CURLINFO_NAMELOOKUP_TIME=1 -DHAVE_CURLINFO_CONNECT_TIME=1 -DHAVE_CURLINFO_PRETRANSFER_TIME=1 -DHAVE_CURLINFO_SIZE_UPLOAD=1 -DHAVE_CURLINFO_SIZE_DOWNLOAD=1 -DHAVE_CURLINFO_SPEED_DOWNLOAD=1 -DHAVE_CURLINFO_SPEED_UPLOAD=1 -DHAVE_CURLINFO_HEADER_SIZE=1 -DHAVE_CURLINFO_REQUEST_SIZE=1 -DHAVE_CURLINFO_SSL_VERIFYRESULT=1 -DHAVE_CURLINFO_FILETIME=1 -DHAVE_CURLINFO_CONTENT_LENGTH_DOWNLOAD=1 -DHAVE_CURLINFO_CONTENT_LENGTH_UPLOAD=1 -DHAVE_CURLINFO_STARTTRANSFER_TIME=1 -DHAVE_CURLINFO_CONTENT_TYPE=1 -DHAVE_CURLINFO_REDIRECT_TIME=1 -DHAVE_CURLINFO_REDIRECT_COUNT=1 -DHAVE_CURLINFO_PRIVATE=1 -DHAVE_CURLINFO_HTTP_CONNECTCODE=1 -DHAVE_CURLINFO_HTTPAUTH_AVAIL=1 -DHAVE_CURLINFO_PROXYAUTH_AVAIL=1 -DHAVE_CURLINFO_OS_ERRNO=1 -DHAVE_CURLINFO_NUM_CONNECTS=1 -DHAVE_CURLINFO_SSL_ENGINES=1 -DHAVE_CURLINFO_COOKIELIST=1 -DHAVE_CURLINFO_LASTSOCKET=1 -DHAVE_CURLINFO_FTP_ENTRY_PATH=1 -DHAVE_CURLINFO_REDIRECT_URL=1 -DHAVE_CURLINFO_PRIMARY_IP=1 -DHAVE_CURLINFO_APPCONNECT_TIME=1 -DHAVE_CURLINFO_CERTINFO=1 -DHAVE_CURLINFO_CONDITION_UNMET=1 -DHAVE_CURLOPT_KEYPASSWD=1 -DHAVE_CURLOPT_DIRLISTONLY=1 -DHAVE_CURLOPT_APPEND=1 -DHAVE_CURLOPT_KRBLEVEL=1 -DHAVE_CURLOPT_USE_SSL=1 -DHAVE_CURLOPT_TIMEOUT_MS=1 -DHAVE_CURLOPT_CONNECTTIMEOUT_MS=1 -DHAVE_CURLOPT_HTTP_TRANSFER_DECODING=1 -DHAVE_CURLOPT_HTTP_CONTENT_DECODING=1 -DHAVE_CURLOPT_NEW_FILE_PERMS=1 -DHAVE_CURLOPT_NEW_DIRECTORY_PERMS=1 -DHAVE_CURLOPT_POSTREDIR=1 -DHAVE_CURLOPT_OPENSOCKETFUNCTION=1 -DHAVE_CURLOPT_OPENSOCKETDATA=1 -DHAVE_CURLOPT_COPYPOSTFIELDS=1 -DHAVE_CURLOPT_PROXY_TRANSFER_MODE=1 -DHAVE_CURLOPT_SEEKFUNCTION=1 -DHAVE_CURLOPT_SEEKDATA=1 -DHAVE_CURLOPT_CRLFILE=1 -DHAVE_CURLOPT_ISSUERCERT=1 -DHAVE_CURLOPT_ADDRESS_SCOPE=1 -DHAVE_CURLOPT_CERTINFO=1 -DHAVE_CURLOPT_USERNAME=1 -DHAVE_CURLOPT_PASSWORD=1 -DHAVE_CURLOPT_PROXYUSERNAME=1 -DHAVE_CURLOPT_PROXYPASSWORD=1 -DHAVE_CURLOPT_SSH_HOST_PUBLIC_KEY_MD5=1 -DHAVE_CURLOPT_NOPROXY=1 -DHAVE_CURLOPT_TFTP_BLKSIZE=1 -DHAVE_CURLOPT_SOCKS5_GSSAPI_SERVICE=1 -DHAVE_CURLOPT_SOCKS5_GSSAPI_NEC=1 -DHAVE_CURLOPT_PROTOCOLS=1 -DHAVE_CURLOPT_REDIR_PROTOCOLS=1 -DHAVE_CURLOPT_SSH_AUTH_TYPES=1 -DHAVE_CURLOPT_SSH_PUBLIC_KEYFILE=1 -DHAVE_CURLOPT_SSH_PRIVATE_KEYFILE=1 -DHAVE_CURLOPT_FTP_SSL_CCC=1 -DHAVE_CURLOPT_COOKIELIST=1 -DHAVE_CURLOPT_IGNORE_CONTENT_LENGTH=1 -DHAVE_CURLOPT_FTP_SKIP_PASV_IP=1 -DHAVE_CURLOPT_FTP_FILEMETHOD=1 -DHAVE_CURLOPT_LOCALPORT=1 -DHAVE_CURLOPT_LOCALPORTRANGE=1 -DHAVE_CURLOPT_CONNECT_ONLY=1 -DHAVE_CURLOPT_CONV_FROM_NETWORK_FUNCTION=1 -DHAVE_CURLOPT_CONV_TO_NETWORK_FUNCTION=1 -DHAVE_CURLOPT_CONV_FROM_UTF8_FUNCTION=1 -DHAVE_CURLOPT_MAX_SEND_SPEED_LARGE=1 -DHAVE_CURLOPT_MAX_RECV_SPEED_LARGE=1 -DHAVE_CURLOPT_FTP_ALTERNATIVE_TO_USER=1 -DHAVE_CURLOPT_SOCKOPTFUNCTION=1 -DHAVE_CURLOPT_SOCKOPTDATA=1 -DHAVE_CURLOPT_SSL_SESSIONID_CACHE=1 -DHAVE_CURLOPT_WRITEDATA=1 -DCURL_STATICLIB -O3 -Wall -std=gnu99 -mtune=core2 -c base64.c -o base64.o
In file included from base64.c:1:0:
Rcurl.h:4:23: fatal error: curl/curl.h: No such file or directory
#include <curl/curl.h>
^
compilation terminated.
make: *** [C:/PROGRA1/R/R-361.3/etc/i386/Makeconf:208: base64.o] Error 1
ERROR: compilation failed for package 'RCurl'

  • removing 'C:/Users/axeld/Documents/R/win-library/3.6/RCurl'
  • restoring previous 'C:/Users/axeld/Documents/R/win-library/3.6/RCurl'
    Error: Failed to install 'Rraven' from GitHub:
    (converted from warning) installation of package ‘RCurl’ had non-zero exit status

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.