Custom deducer installation

454 views
Skip to first unread message

Misha

unread,
Jan 4, 2011, 7:01:44 AM1/4/11
to Deducer
I'm trying to install deducer on my work computer where I dont have
administrative privileges and hence have a portable R installation
that works allright. Deducer and jgr installs allright including the
java bit, but I'm unabe to create the launchJGR.bat file.

my lauchJGR.bat file looks like this and is placed in the jgr folder:

set R_LIBS=P:\R prg\R-2.11.1\library
set R_HOME=P:\R prg\R-2.11.1
jgr.exe --libpath=%R_LIBS% --rhome=%R-HOME%

However I'm getting the error msg that

"non-existent directory specified in --libpath=."

However the path assigned above is the correct path. Any ideas?

Regards,
M





Ian Fellows

unread,
Jan 4, 2011, 12:19:44 PM1/4/11
to ded...@googlegroups.com
try putting quotes around the paths, or escape spaces with \

ian

Misha

unread,
Jan 6, 2011, 5:28:38 AM1/6/11
to Deducer
set R_LIBS=P:\R prg\R-2.11.1\library
set R_HOME=P:\R prg\R-2.11.1
jgr.exe --libpath%R_LIBS% --rhome%R-HOME%

This seems to find the right path, but I get the error msg that rhome
is not found in the registry.
> > M- Hide quoted text -
>
> - Show quoted text -

Ian Fellows

unread,
Jan 6, 2011, 12:18:27 PM1/6/11
to ded...@googlegroups.com
Did you try putting quotes around your path. Something like:

set R_LIBS="P:\R prg\R-2.11.1\library"


set R_HOME="P:\R prg\R-2.11.1"

jgr.exe --libpath="P:\R prg\R-2.11.1\library" --rhome="P:\R prg\R-2.11.1"

Bruce Miller

unread,
Jan 13, 2011, 4:15:43 PM1/13/11
to ded...@googlegroups.com
Hi Ian et al.,

Are there data size limits for Deducer or dictated by R?

I need to look at temporal activity for bats and my data files are fairly large...
The main data set has 305,000 records.

A subset  sample of a single family it is 3.7MB  as CSV file with 129,071 records.
The data is simple with 4 variables.

String=Species
String=location
Date=factor
Time=factor

Data is output from my database as CSV in this format.
with a header row

Species,Location,Date,Time
Mormeg,3,11/12/1995,20:59
Mormeg,3,11/12/1995,21:00
Mormeg,4,7/18/1995,18:40
Mormeg,4,7/18/1995,18:41
Mormeg,4,7/18/1995,18:41
Mormeg,4,7/18/1995,18:42
Mormeg,4,7/18/1995,18:42
Mormeg,4,7/18/1995,18:44
Mormeg,4,7/18/1995,18:45
Mormeg,14,2/15/1995,20:03
Mormeg,14,2/15/1995,20:08
Mormeg,14,2/15/1995,20:08
Mormeg,21,2/9/1995,20:06
Mormeg,23,2/9/1995,20:06
Mormeg,25,11/22/1995,20:51
...etc...



The variable view choices are string, factor, integer, double and logical but no time or date.

I really would like to plot the data like this (below).
I can do it in R with command lines and GGPLOT, but would prefer to use Deducer.
Ian any way to develop a template for your GGplot interface in Deducer to do this?



--
BruceW.Miller,Ph.D.
ConservationEcologist
NeotropicalBatProject


officedetails
GallonJug,Belize
Mailingaddress
P.O.Box37,BelizeCity
Belize,CentralAmerica
Phone+501-220-9002

Ian Fellows

unread,
Jan 13, 2011, 4:48:18 PM1/13/11
to ded...@googlegroups.com
Bruce,

Deducer 0.4-3 added support for dates and times to the data viewer, so make sure you have the latest version of the package. When converting from strings, the viewer assumes that the format is year/month/day rather than the day/month/year of your data. So you will have to use the command line to get your variables into the right class.

There is a limitation on the size of data that the data viewer can handle. I hope to remove this limitation in a future release. Experimenting with my own system, the data viewer starts to choke up after 25 million cells ( I tried a set with 500,000 observations and 50 variables). If you work with large datasets, I recommend just keeping the data viewer closed.


Ian

Bruce Miller

unread,
Jan 14, 2011, 11:03:34 AM1/14/11
to ded...@googlegroups.com
Tnx Ian,

I thought I had the latest version, but obviously not :-).

I now have it installed and see the new options for data/time etc.

Not quite sure about the dates & times since they are not strings when opened in Excel.
The dataset I am playing ahem... working with now is attached.
They are exported from Access as part of a Vbasic code string as CSV format.
I can export this form an Access table and or cut and paste tot he Data Viewer if that helps?

This format works with the lines of code Hadley helped me with for GGPLOT a few years back, so I was anticipating they would work in Deducer.

I was now trying to simply do the Density Plots by times to see  what "time frames" were suggested as the most active periods.

Your reply on limits on data sizes was helpful.

Thanks again.

Bruce.



On 1/13/2011 3:48 PM, Ian Fellows wrote:
When converting from strings, the viewer assumes that the format is year/month/day rather than the day/month/year of your data. So you will have to use the command line to get your variables into the right class.
Ian


-- 
Bruce W. Miller, Ph.D.
Conservation Ecologist
Neotropical Bat Project


office details
Gallon Jug, Belize
Mailing address
P.O. Box 37, Belize City
Belize, Central America
Phone +501-220-9002

Mormoopids.zip

Ian Fellows

unread,
Jan 14, 2011, 6:42:30 PM1/14/11
to ded...@googlegroups.com
Bruce,

So I've added better date and time conversion to the data viewer,
supporting a variety of formats. There is really no reason the user
should be limited to the 2010-10-10 format. This will be available in
the 0.4-4 release of deducer.

To do what you want, you do need to write a few lines of R code to
manipulate the Time variable into a numeric format. Perhaps I'll add a
string manipulation dialog at some point, but I don't see that
happening too soon.

ian

Mormoopids <- read.table("/Users/ianfellows/Downloads/Mormoopids.CSV",header=T,sep=",",quote="")
#open data dialog
Mormoopids[,3]<-as.Date(Mormoopids[,3], format= '%m/%d/%Y')
#Deducer 0.4-4 Data viewer type conversion

#hand written code to convert time into numeric
tmp <- strsplit(Mormoopids$Time,":")
Mormoopids$Hour <- sapply(tmp,function(x) as.numeric(x[1]) +
as.numeric(x[2])/60 )
#end hand written code

#plot builder
dev.new()
ggplot() +
geom_density(aes(x = Hour,colour = Species),data=Mormoopids) +
theme_bw()

bats.ggp
bats.png

Misha

unread,
Jan 25, 2011, 7:29:57 AM1/25/11
to Deducer
Still doesnt work. Unfortunately.

I get the error mrg:

"Non-existent directory specified in --libpath=."

Regards,

/M


On Jan 6, 6:18 pm, Ian Fellows <ifell...@gmail.com> wrote:
> Did you try putting quotes around your path. Something like:
>
> set R_LIBS="P:\R prg\R-2.11.1\library"
> set R_HOME="P:\R prg\R-2.11.1"
> jgr.exe --libpath="P:\R prg\R-2.11.1\library" --rhome="P:\R prg\R-2.11.1"
>
>
>
> On Thu, Jan 6, 2011 at 2:28 AM,Misha<mole...@gmail.com> wrote:
> > set R_LIBS=P:\R prg\R-2.11.1\library
> > set R_HOME=P:\R prg\R-2.11.1
> > jgr.exe --libpath%R_LIBS% --rhome%R-HOME%
>
> > This seems to find the right path, but I get the error msg that rhome
> > is not found in the registry.
>
> > On Jan 4, 6:19 pm, Ian Fellows <ifell...@gmail.com> wrote:
> >> try putting quotes around the paths, or escape spaces with \
>
> >> ian
>
> >> On Tue, Jan 4, 2011 at 4:01 AM,Misha<mole...@gmail.com> wrote:
> >> > I'm trying to install deducer on my work computer where I dont have
> >> > administrative privileges and hence have a portable R installation
> >> > that works allright. Deducer and jgr installs allright including the
> >> > java bit, but I'm unabe to create the launchJGR.bat file.
>
> >> > my lauchJGR.bat file looks like this and is placed in the jgr folder:
>
> >> > set R_LIBS=P:\R prg\R-2.11.1\library
> >> > set R_HOME=P:\R prg\R-2.11.1
> >> > jgr.exe --libpath=%R_LIBS% --rhome=%R-HOME%
>
> >> > However I'm getting the error msg that
>
> >> > "non-existent directory specified in --libpath=."
>
> >> > However the path assigned above is the correct path. Any ideas?
>
> >> > Regards,
> >> > M- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -

Ian Fellows

unread,
Jan 27, 2011, 3:05:52 AM1/27/11
to ded...@googlegroups.com
Misha,

Try the following and let me know if it works.
1. open R and run the code below.
2. copy the output into a bat file (i.e. jgrLaunch.bat)
3. double click on the pat file

jgrLaunchScript <- function(launcher_loc = NULL) {
win <- Sys.info()[1] == "Windows"
rhome <- R.home()
libs <- paste(.libPaths(), sep = ";", collapse = ifelse(win,
";", ":"))
if (win) {
libs <- gsub("/", "\\\\", libs)
rhome <- gsub("/", "\\\\", rhome)
}

if (is.null(launcher_loc)) {
cat("please select the location of your jgr launcher\n")
launcher_loc <- file.choose()
}

cmd <- paste("set R_HOME=", rhome, "\n", "set R_LIBS=", libs,
"\n", sep = "")
if (win) {
cmd <- paste("set R_HOME=", rhome, "\n", "set R_LIBS=",
libs, "\n", sep = "")
cmd <- paste(cmd, launcher_loc, " --rhome=", rhome, " --libpath=",
libs, sep = "")
}
else {
cmd <- paste("csh\nsetenv R_HOME \"", rhome, "\"\n",
"setenv R_LIBS \"", libs, "\"\n", sep = "")
cmd <- paste(cmd, launcher_loc,"/Contents/MacOS/JGR", sep = "")
}
if(win)
cat("\n\nCopy the following into WordPad and save as \"jgrLaunch.bat\"\n\n")
cat(cmd,"\n")
cat("\n\n\n")
invisible(cmd)
}
jgrLaunchScript()

Misha

unread,
Jan 29, 2011, 5:28:05 AM1/29/11
to Deducer
I truly do appreciate your efforts and the solution looks promising
since now at least the paths are allright (involved tildes). However,
JGR is not launched. I started cmd and I get the following error msg:

R is not recognized as an internal or external command, executable
file or "something I cannot translate.." file.

Misha
> >> - Show quoted text -– Skjul sitert tekst –
>
> – Vis sitert tekst –

Misha

unread,
Jan 29, 2011, 5:32:26 AM1/29/11
to Deducer

Here is the new .bat file:

set R_HOME=P:\RPRG~1\R-211~1.1
set R_LIBS=P:\RPRG~1\R-211~1.1\library
P:\R prg\JGR\jgr.exe --rhome=P:\RPRG~1\R-211~1.1 --libpath=P:
\RPRG~1\R-211~1.1\library



Misha

On 27 Jan, 09:05, Ian Fellows <ifell...@gmail.com> wrote:

Misha

unread,
Jan 29, 2011, 5:58:52 AM1/29/11
to Deducer
I did modify it as follows:

set R_HOME=P:\RPRG~1\R-211~1.1\bin
set R_LIBS=P:\RPRG~1\R-211~1.1\library
P:\RPRG~1\JGR\jgr.exe --rhome=P:\RPRG~1\R-211~1.1\bin --libpath=P:
\RPRG~1\R-211~1.1\library


Now JGR started but could not find the rJAVA dll and ended. Hence I
installed rJava from cran. Now I get that R.exe cannot be found and
that R v 2.3 should be installed. I have R 2.11.1.

??
> > – Vis sitert tekst –– Skjul sitert tekst –
>
> – Vis sitert tekst –

Misha

unread,
Jan 29, 2011, 6:05:35 AM1/29/11
to Deducer

And in the end I restored the bat file back without the \bin endings
and now JGR launched after reinstalling rJava. I believe the error was
that rJava was not installed with its .dll before trying to run the
JGR installer.

So a happy ending at last.

Misha



On 29 Jan, 11:32, Misha <mole...@gmail.com> wrote:
> > – Vis sitert tekst –– Skjul sitert tekst –
>
> – Vis sitert tekst –

Ian Fellows

unread,
Jan 29, 2011, 12:52:17 PM1/29/11
to ded...@googlegroups.com
Misha,

I'm glad you finally got it working. I don't know how you had JGR
installed, but not rJava. 99% of the time JGR can be run by just
double clicking on the jgr-1_62.exe launcher. 1% of the time, however,
the user's R set-up is imposible to know a priori, and they must
specify the paths themselves. I view this unacceptably complex.

The development version of JGR now has a new feature to mitigate this
problem. If you can run require(JGR) in R, you should be able to
launch JGR. The steps are as follows

1. Open R

2. Install development JGR by running
install.packages('JGR',,'http://www.rforge.net/')

3. run
library(JGR)
JGR()

note: If you are not running Windows R>=2.12.0 you will need to use
install.packages('JGR',,'http://www.rforge.net/', type="source") to
get the development version of JGR.

Given the vast array of possible set-ups, I'd appreciate it if anyone
with a custom set-up (i.e. double clicking on the launcher doesn't cut
it) could try this and let me know if there are any problems.

Best,
Ian

Reply all
Reply to author
Forward
0 new messages