Can't install R package koRpus

384 views
Skip to first unread message

Earl Brown

unread,
Aug 13, 2011, 10:27:21 PM8/13/11
to CorpLing with R
Has anyone successfully installed the R package "koRpus"? It
apparently has a wrapper for the POS tagger TreeTagger, which I'd love
to use in R rather than in a Terminal window. I've tried to install
it, but the command in the R console:

install.packages("koRpus")

gives me the error:

"In getDependencies(pkgs, dependencies, available, lib) : package
‘koRpus’ is not available (for R version 2.13.1)"

When I download the file "koRpus_0.03-4.tar.gz" from the page
http://www.reaktanz.de/?c=hacking&s=koRpus and then put the unzipped
folder in my R library, where all my other R packages are, and try in
the R console:

library("koRpus")

it gives me this error message:

"Error in library(koRpus) : 'koRpus' is not a valid installed package"

I'd love to use this package, but I can't figure out how to install
it. Any ideas? Thanks in advance. Earl Brown

Stefan Th. Gries

unread,
Aug 13, 2011, 10:29:29 PM8/13/11
to corplin...@googlegroups.com
works fine here (Linux Mint 11) when I do this:

install.packages("koRpus", repo="http://R.reaktanz.de/koRpus")

STG
--
Stefan Th. Gries
-----------------------------------------------
University of California, Santa Barbara
http://www.linguistics.ucsb.edu/faculty/stgries
-----------------------------------------------

Earl Brown

unread,
Aug 13, 2011, 11:18:41 PM8/13/11
to CorpLing with R
Still no luck here. I still get an error message:

> install.packages("koRpus", repo="http://R.reaktanz.de/koRpus")

Installing package(s) into ‘/Users/brow2662/Library/R/2.13/library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository
http://R.reaktanz.de/koRpus/bin/macosx/leopard/contrib/2.13
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘koRpus’ is not available (for R version 2.13.1)

Maybe it doesn't work with Mac, as the warning message includes info
about macs: "/macosx/leopard/".

Could I install the package on my Windows home computer and then
simply put the folder on a flash drive and then put that folder onto
my Mac, in the folder with all my other R packages? Any other ideas?

Thanks for a great stats workshop, btw. Earl Brown

Stefan Th. Gries

unread,
Aug 14, 2011, 6:05:30 AM8/14/11
to corplin...@googlegroups.com
> Could I install the package on my Windows home computer and then simply put the folder on a flash drive and then put that folder onto my Mac, in the folder with all my other R packages? Any other ideas?
Not sure that'll work but since it can't damage anything, why not try?

> Thanks for a great stats workshop, btw.

:-) thx!

John Newman

unread,
Aug 14, 2011, 11:47:02 AM8/14/11
to corplin...@googlegroups.com
On my Mac, the following works:

In Terminal, change to the directory where the downloaded koRpus_0.03-4.tar.gz file is located. Then use the command:

R CMD install koRpus_0.03-4.tar.gz

Here are the first few lines of the response in Terminal

John-Newmans-MacBook-Pro:Desktop johnnewman$ R CMD install koRpus_0.03-4.tar.gz* installing to library ‘/Users/johnnewman/Library/R/2.10/library’
* installing *source* package ‘koRpus’ ...
** R
** data
** inst
** preparing package for lazy loading
...

I have TreeTagger installed, so then,  in Terminal or in the R Console,  I use the following commands as suggested in the documentation to tag Jane Austin's Emma:
library(koRpus)
tagged.text <- treetag("~/Documents/Emma.txt", treetagger="manual", lang="en", TT.options=c(path="~/TreeTagger", preset="en"))
        reading parameters ...
        tagging ...
189000   finished.

> tagge...@TT.res[1:10,1:3] #to display the first 10 rows and just the first 3 columns of results:
       token tag     lemma
1        The  DT       the
2    Project  NP   Project
3  Gutenberg  NP Gutenberg
4      EBook  NP <unknown>
5         of  IN        of
6       Emma  NP      Emma
7          ,   ,         ,
8         by  IN        by
9       Jane  NP      Jane
10    Austen  NP    Austen


John



--
You received this message because you are subscribed to the Google Groups "CorpLing with R" group.
To post to this group, send email to corplin...@googlegroups.com.
To unsubscribe from this group, send email to corpling-with...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/corpling-with-r?hl=en.




--
John Newman
Professor and Chair
Department of Linguistics, 4-32 Assiniboia Hall, University of Alberta
Edmonton T6G 2E7 CANADA
Fax: (780) 492-0806, Tel: (780) 492-5500
Homepage: http://johnnewm.jimdo.com

Earl Brown

unread,
Aug 15, 2011, 4:04:49 PM8/15/11
to CorpLing with R
Thanks John for the code. I was able to successfully install the
package and tag a sample text in English. As I work with Spanish,
which I see is not currently one of the supported preset languages,
I'm now trying to alter the treetag() function code to put in Spanish
as an additional preset language, but I haven't yet made it work
correctly. I think I need to change the code in the set.kRp.env()
function too. Anyway, thanks for your help. Earl Brown

Earl Brown

unread,
Aug 30, 2011, 12:50:08 AM8/30/11
to CorpLing with R
FYI:
Spanish is now a preset language in the treetag() function within the
koRpus package, for either latin1 or utf8 encoded files. If you'd
like, you can update your version with:

install.packages("koRpus", repo="http://R.reaktanz.de")

at the R console, as this package isn't yet in CRAN.
Best, Earl Brown
Reply all
Reply to author
Forward
0 new messages