Check boxes group with only one box

127 views
Skip to first unread message

Helios De Rosario

unread,
Dec 11, 2011, 8:07:36 PM12/11/11
to Deducer
I'm trying to write a dialog with one option that can be checked/
unchecked, and I've got the following error:

> checkbox <- new(CheckBoxesWidget, "option1")
Error in .jcall("RJavaTools", "Ljava/lang/Object;",
"newInstance", .jfindClass(class), :
java.lang.NoSuchMethodException: No constructor matching the given
parameters

I have found out that the error is caused because this way of
constructing the CheckBoxesWidget fails if the list of options is
shorter than 2.

After looking at the defintion of availabel methods for
CheckBoxesWidget <http://www.rforge.net/org/docs/org/rosuda/deducer/
widgets/CheckBoxesWidget.html#method_summary> I have found a
workaround: build a group with two boxes, and then removing the second
one (with index 1), i.e.:

> checkbox <- new(CheckBoxesWidget, c("option1", "option2"))
> checkbox$removeButton(1L)

But is there a smarter way to do it? Is this a feature of the R-
constructor, or a bug?

Thanks
Helios

Ian Fellows

unread,
Dec 11, 2011, 8:35:12 PM12/11/11
to ded...@googlegroups.com
rJava automatically converts multiple element vectors to java arrays
and single element vectors to java Strings. While not ideal, you can
tell rJava that you want "option1" to be treated as an array with:

new(CheckBoxesWidget, .jarray("option1"))

While not _technically_ a bug, I should write some constructors to
handle String input.

Best,
Ian

Bruce Miller

unread,
Dec 14, 2011, 11:11:58 AM12/14/11
to ded...@googlegroups.com
Hi all,

Trying to do some plots in Deducer, but not going well.
I need to create some scatter plots but not use the the linear model just add 2 variables for X and Y.

My DF variables are fine and when I try to build my own formula to plot  E.G. 

Pmc <- (100 * ( Fmax - Fc ) / Fc) It does not seem to work?



The drop down menu in that latest Deducer > Plots>Interactive does not seem to work when sleected it disappears from the screen.  Plot Builder does works as does open plot and import template but Interactive does not seem to.

Puzzled.

Bruce


-- 
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

Bruce Miller

unread,
Dec 15, 2011, 6:41:16 AM12/15/11
to ded...@googlegroups.com
Hi all,

How can I set Deducer DataViewer to open files that contain values of Zero =0?

These are valid values for the parameters I need to evaluate.
I have tried CSV and tab formats.
Trying XL Connect and/or XLConnectJars dies not seem to work to open Excel files so I am at a loss on how to get the data into Deducer.


Sample of data with 0 values:

    Filename     Dur       TBC      Fmax    Fmin   Fmean      Fc       S1       Sc     Pmc
g8221843.13# 5.06 0 38.93 36.2 37.96 36.45 -34.08 192.69 6.8
g8221843.13# 0.41 5.29 38.83 36.04 38.83 38.83 -261.93 -513.05 0
g8221843.13# 0.66 0.68 35.71 33.4 36.42 35.63 -238.04 -392.06 0.2
g8221843.13# 0.58 54.84 42.78 40.3 41.1 40.3 410 0 6.2

This message is displayed in the console:

> BASCTWS <- read.table("C:/=Bat data working/R/BASCTWS.txt",header=T,sep="\t",quote="")
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
  line 1 did not have 10 elements

Ian Fellows

unread,
Dec 15, 2011, 11:24:27 AM12/15/11
to ded...@googlegroups.com
the problem is most likely the # in the first line, which is interpreted as a comment character. try

 BASCTWS <- read.table("C:/=Bat data working/R/BASCTWS.txt",header=T,sep="\t",quote="",comment.char="")

ian

Bruce Miller

unread,
Dec 27, 2011, 11:35:57 AM12/27/11
to ded...@googlegroups.com
Hi all,

Trying to use Plot Builder in Deducer to make a simple X vs. Y plot
like one can in Excel.
The template for scatter plots only has y ~ x as a linear model so if I
need to blog values like this:

Blood Glucose (a numerical value) on Y and want
day of the week (text-character) on the X it does not work.

Obviously since Deducer is designed for stat work, so I may need to go
back to composing GGPLOT2 code lines for this?

Bruce

Tom Hopper

unread,
Dec 27, 2011, 12:55:45 PM12/27/11
to ded...@googlegroups.com
Bruce,

I plot data like this all the time in Deducer.

Go to "Geometric Elements" and choose "points," then enter your days of week for the "x" variable and your blood glucose variable for the "y" variable. You can also reverse these to achieve a Cleveland-style dot plot.

You can also add another variable for color or additional elements, such as a smoother or ribbon.

You may find better luck if you first convert your day-of-week variable to a factor instead of a character vector. This can be done from the Deducer Data Viewer by clicking on "Variable View" and then changing the type. After doing this, you may find it beneficial to to click on the "Factor levels" field and sort the levels.

Best of luck,

Tom

Bruce Miller

unread,
Dec 27, 2011, 2:26:29 PM12/27/11
to ded...@googlegroups.com, tomh...@gmail.com
WOW,

Thanks Tom,

Exactly what I needed to know.

Have a great 2012,

Cheers from the jungles of Belize,

Bruce

Bruce Miller

unread,
Jan 10, 2012, 7:21:41 AM1/10/12
to ded...@googlegroups.com
Clearly something has changed at my end with Deducer 1.7.9.

I have an issue reading in either tab or comma limited data sets.

Using Open Data from Data Viewer and the Header box checked I have this
in the console.

> Params <- read.table("C:/=Bat data
working/=Rio_Azul/Params.txt",header=T,sep="\t",quote="")


Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
na.strings, :

line 1 did not have 15 elements
> Params_AML <- read.table("C:/=Bat data
working/=Rio_Azul/Params_AML.csv",header=T,sep=",",quote="")


Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
na.strings, :

line 1 did not have 15 elements

There are no missing data elements in the data sets and while some have
a value of "0" zero, threre are no zeros in line 1.
E.G.

Filename Dur Fmax Fmin Fmean Tk
Fk Qk Tc Fc Dc S1
Sc Qual Pmc
D7161925.20# 1.45 51.78 48.93 49.83 0.16 51.78
1.62 1.28 48.93 1.12 -409.79 72.67 0.48 5.8
D7161925.20# 2.29 52.12 47.48 48.87 0.32 50.79
1.45 2.12 47.62 1.81 117.82 51.5 0.17 9.4
D7161925.20# 2.15 51.12 46.92 48.26 0.16 51.12
1.18 1.81 47.2 1.66 -427.42 69.48 0.44 8.3
D7161925.20# 0.32 51.28 50.16 50.16 0.16 50.63
0.56 0.32 50.16 0.16 116.32 84.67 0.06 2.2
D7161935.59# 1.92 51.78 48.93 50.13 0.16 51.45
0.34 1.59 49.54 1.43 59.66 38.14 0.26 4.5
....

Also for some reason Deducer now opens with a previous workspace and
opens old data sets rather than a new blank workspace?
I have redefined the default working directory to a new Temp empty
directory as well, but it continues to open an old workspace and data.

Bruce

Ian Fellows

unread,
Jan 10, 2012, 8:19:20 AM1/10/12
to ded...@googlegroups.com
Bruce,

1. The # marks denote comments in read.table. delete them and it should work.
2. To clear your workspace go to workspace->Clear All and then to
workspace->save. Now restart JGR

Ian

Bruce Miller

unread,
Jan 10, 2012, 8:22:51 AM1/10/12
to ded...@googlegroups.com
Tnx Ian,

Poop... Yep forgot about that from last time a few months ago.

Just updated to R14.1 and doing all library updates.

Bruce

Bruce Miller

unread,
Mar 22, 2012, 11:30:33 AM3/22/12
to ded...@googlegroups.com
Hi all,

My main Dell melted down a month ago and I need to buy a new workstation.
It will be Win7 64 bit and fast graphics card with large RAM.

For GIS (ArcGis) I am opting for 6 GB RAM.
Is there any advantage for R to boost this to 8 GB or will 6 GB be
sufficient for R applications?
There have been a lot of discussion about "Big Memory" issues with R.

Michael Bishop

unread,
Mar 22, 2012, 12:53:35 PM3/22/12
to ded...@googlegroups.com
6gb?  Desktop memory is super cheap  http://www.newegg.com/Store/SubCategory.aspx?SubCategory=147&name=Desktop-Memory .  Unless you are absolutely broke get 16gb.

Duleep Samuel

unread,
Mar 23, 2012, 12:25:36 AM3/23/12
to ded...@googlegroups.com
get 32 GB RAM, get a good nvidia card with 1 / 1.5 / 3 GB VRAM, also get a good antivirus as in my experience, 64 bit win 7 is more affected by viruses which sneak in, but you may not see a great increase in speed as deducer is a JAVA compiled program, Samuel, Bangalore
Reply all
Reply to author
Forward
0 new messages