Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble loading wordnet package in R

Tags:

r

wordnet

I have trouble loading wordnet into R. I use R x64 2.14.1. I installed the package wordnet and then I tried to load the package.

> library(wordnet)
Warning message:
In initDict() :
  cannot find WordNet 'dict' directory: please set the environment variable WNHOME to its parent

What is wrong? How and to what should I set the directory WNHOME.

like image 647
Borut Flis Avatar asked Jan 15 '12 09:01

Borut Flis


2 Answers

I had this problem and solved it by downloading and installing wordnet from http://wordnetcode.princeton.edu/2.1/WordNet-2.1.exe and then rerunning

library(wordnet)
setDict("C:/Program Files (x86)/WordNet/2.1/dict")
like image 131
roselilly Avatar answered Oct 21 '22 20:10

roselilly


This works fine. We need to set WNHOME to dict's parent directory which is ./WordNet/2.1 from R using Sys.setenv()

library(wordnet)
setDict("C:/Program Files (x86)/WordNet/2.1/dict")
Sys.setenv(WNHOME = "C:/Program Files (x86)/WordNet/2.1") 
like image 44
Venkatesh Nagella Avatar answered Oct 21 '22 22:10

Venkatesh Nagella