Non-standard file/directory found at top level error when adding a sound file in my package

Viewed 568

I am trying to make my first personal R package where I am passing few .wav files in my package like so:

#....extra code
natural_noise <- "birdsound.wav"
wav_file_location <- system.file(paste("sound/", natural_noise, sep=""), package= "package1")

I have a the file birdsound.wav in a sound folder within the same R package project directory. But it is keep leading to error when I use the Check feature:
checking top-level files ... NOTE Non-standard file/directory found at top level: 'sound'

When I delete my folder and move the wav file out of the folder, I get same error with but last line changes:
checking top-level files ... NOTE Non-standard file/directory found at top level: birdsound.wav

Can some one give me direction. I have looked at google and forums here already. Thank you.

1 Answers

Put extra files in the inst directory within the package. For a sound-specific example, see the structure of the beepr package, which puts .wav files in inst/sounds/.

The R Packages book has a section with more deatails.

Related