Character encoding sits somehow in between R and your OS; it can be difficult to troubleshoot. (i.e. welcome to encoding hell!
)
What platform are you using? And what locale you have set up (= what do you get when running Sys.getlocale() ?)
When I had a similar issue – I had trouble displaying Czech, not Danish characters, so not exactly the same but very similar – I solved it by including this code in my .Rprofile
if (.Platform$OS.type == 'windows') {
Sys.setlocale(category = 'LC_ALL','English_United States.1250')
} else {
Sys.setlocale(category = 'LC_ALL','en_US.UTF-8')
}
You may want to edit the script to suit your language - code page 1250 is relevant for Central European languages, I believe that Danish script uses 865 but I may be wrong here...