R 'tm' package example from Vol.8/2 Oct. 2008 RNews

5 views
Skip to first unread message

Matthew Bascom

unread,
Jul 8, 2009, 11:15:11 AM7/8/09
to hel...@googlegroups.com
Hello,
 
I'm trying to load Wizard of Oz text data into R.
 
Datasources include gutenberg.org and a couple other text-based sources.
 
I'm referring to the article on page 19/75 at http://www.r-project.org/doc/Rnews/Rnews_2008-2.pdf

I have named the folder holding the text documents OzBooks, as is used in the example.
 
However, when I run
 
> oz <- Corpus(DirSource("OzBooks/"))
 
I get the following error message:

Error in sapply(d, file.info)["isdir", ] : incorrect number of dimensions
In addition: Warning message:
In dir(directory, full.names = TRUE, pattern = pattern, recursive = recursive,  :
  list.files: 'OzBooks/' is not a readable directory
 
Any thoughts?
 
Thank you for your time.
 
-Matt
 

Mark Knecht

unread,
Jul 8, 2009, 11:40:51 AM7/8/09
to Matthew Bascom, hel...@googlegroups.com

I don't have time to reread the article and try to duplicate things
from scratch however if you will include the exact links to the text
files along with enough code to get to where you failed I'm happy to
look at it.

- Mark

Earl

unread,
Jul 11, 2009, 4:15:13 AM7/11/09
to Bay Area R Helpers
I think that R can't read the directory OzBooks.

Also, you are giving R a path that is relative to your current working
directory which is, unless otherwise specified, where you installed R
and probably not where you dumped your docs.

Either give R a full path, or specify the parent directory of OzBooks
as your working directory with setwd -- then verify with getwd

earl
On Jul 8, 8:15 am, Matthew Bascom <mattbas...@gmail.com> wrote:
> Hello,
>
> I'm trying to load Wizard of Oz text data into R.
>
> Datasources include gutenberg.org and a couple other text-based sources.
>
> I'm referring to the article on page 19/75 athttp://www.r-project.org/doc/Rnews/Rnews_2008-2.pdf
Reply all
Reply to author
Forward
0 new messages