yjlee168
★★★

Kaohsiung, Taiwan,
2015-12-30 21:05
(1790 d 21:02 ago)

(edited by yjlee168 on 2015-12-31 11:45)
Posting: # 15786
Views: 31,496

## GUI for Detlew's randomizeBE (bear v2.7.5) [R for BE/BA]

Dear all,

I just upload bear v2.7.5 to sourceforge at the end of 2015.

This release only added GUI for Detlew's R package - randomizeBE to respond Elmaestro & Helmut's suggestions. I have been looking for a suitable GUI toolkit for a while. Finally I decided to use gWidgest2 and RGtk2 as GUI toolkit after trying several GUI toolkits (such as tcltk). Here is how to install these packages or toolkit file before upgrading bear to v2.7.5.

For Windows and Mac OSX:
1. Open R and under R console, type install.packages("randomizeBE");install.packages("gWidgets2");install.packages("gWidgets2RGtk2") to install these packages from R repository site.
2. install bear v2.7.5 from local zip file for Windows OS or type  sudo R CMD INSTALL bear_2.7.5.tgz for Mac OSX;
3. Under R console, type library(bear). Then type rl.gui() to run GUI. Then it may (or may not) prompt a dialog to ask if like to install GTK+, click install GTK+. It just needs to be done only once or for the first time. After that, close R and open R again to run bear. After typing library(bear), type rl.gui() (Ps. rl: randomization list) to run GUI.

For Linux (Ubuntu x86/x64):
1. Open a terminal and type sudo apt-get install libgtk2.0-dev to install gtk2.0 development version. This will avoid a possible compiling error (...GTK 2.8.0 is required...) when installing next R packages. For distro of yum package installation, please type yum install gtk2-devel (such as Fedora or others). See this for more information.
2. Under a terminal, open R. Then type install.packages("randomizeBE");install.packages("gWidgets2");install.packages("gWidgets2RGtk2") to install these packages from R repository site. This should also install all dependent packages.
3. Rest steps are the same as Windows and Mac OSX, except no need to install GTK+ with Linux-pc. I think GTK+ is bundled together with OS already. Not quite sure about that.

Ps.
1. for Mac OSX and Linux-pc, after clicking exit in GUI, it needs to press "Enter" key once to get R prompt back. There is no need to do so if running bear under RStudio.
2. for now, I just include some commonly used study designs together with GUI. randomizeBE can do much more than what I have built in this GUI. Let me know if you think that I should include more study designs. randomizeBE is a very nice package. Thank Detlew very much.

Screenshot (Windows, Win7 x64)

Screenshot (Windows, Win10 x64)

Screenshot (Mac OSX)

Screenshot (Linux-pc)

That's it. Have fun and Happy New Year.

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mittyri
★★

Russia,
2016-01-03 13:04
(1787 d 05:03 ago)

@ yjlee168
Posting: # 15791
Views: 28,088

## GUI for Detlew's randomizeBE (bear v2.7.5)

Hi Yung-jin,

Thank you so much for your advancing program!

» Open R and under R console, type install.packages("randomizeBE");install.packages("gWidgets2");install.packages("gWidgets2RGtk2") to install these packages from R repository site.

What do you think about automatization this process? Something like that:
if(!require("randomizeBE")) {install.packages("randomizeBE"); require("randomizeBE")}

Kind regards,
Mittyri
yjlee168
★★★

Kaohsiung, Taiwan,
2016-01-03 16:37
(1787 d 01:30 ago)

@ mittyri
Posting: # 15792
Views: 27,988

## just tried to be as simple as possible

Hi mittyri,

Yes, that is really a good way to check and automate the installation of packages. However, I tried to simplify the codes as possible as I can. If I put the line as you suggested in codes, then it will check if the all required packages (one by one) have been installed or not every time when it runs, even though users have already installed all required packages. So I think it is not necessary to do so. But I will update preinst.r (at sourceforge) later. Thanks for your comments.

» What do you think about automatization this process? Something like that:
» if(!require("randomizeBE")) {install.packages("randomizeBE"); require("randomizeBE")}

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mahmoud-teaima
★

2016-02-08 02:48
(1751 d 15:20 ago)

(edited by mahmoud-teaima on 2016-02-08 02:58)
@ yjlee168
Posting: # 15941
Views: 26,860

## GUI for Detlew's randomizeBE (bear v2.7.5)

» 2. install bear v2.7.5 from local zip file for Windows OS or type  sudo R CMD INSTALL bear_2.7.5.tgz for Mac OSX;

Please tell me how to do this step on mac in more details. Greetings.

Mahmoud Teaima, PhD.
mahmoud-teaima
★

2016-02-08 02:51
(1751 d 15:17 ago)

@ yjlee168
Posting: # 15942
Views: 26,860

## GUI for Detlew's randomizeBE (bear v2.7.5)

Dear all,
sorry for the previous post.
i'm setting bear 2.7.5 on my mac, i need more detailed steps especially step 2.
appreciate your help a lot.
Greetings.

Mahmoud Teaima, PhD.
yjlee168
★★★

Kaohsiung, Taiwan,
2016-02-08 05:11
(1751 d 12:57 ago)

@ mahmoud-teaima
Posting: # 15943
Views: 26,911

## Installation problems with bear?

Dear mahmoud-teaima,

Have you installed R (apk) and its related development tools and libraries on you mac (if no, please read this)? Have you run bear on your mac before? If yes, please show me the error messages that you have seen during installation processes before I can help. The above installation steps are just for the part of GTK+ libraries running with bear v2.7.5. Thanks.

» [...] i'm setting bear 2.7.5 on my mac, i need more detailed steps especially step 2.[...]

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mahmoud-teaima
★

2016-02-08 10:16
(1751 d 07:51 ago)

@ yjlee168
Posting: # 15944
Views: 26,858

## Installation problems with bear?

i have installed R 3.2.3 and using Rstudio 0.99.491.dmg, i also installed gfortran4.2.3 and XQuartz2.7.8.
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin13.4.0 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.   Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. [Workspace loaded from ~/.RData]

i did not run bear on my mac before.
i did step 1 in your mentioned steps but i stuck in step two, when i write the install.packages(file.choose()) in the R console to browse for the bear_2.7.5.tgz an error message as follows

install.packages(file.choose()) Installing package into ‘/Users/mahmoudteaima/Library/R/3.2/library’ (as ‘lib’ is unspecified) Warning in install.packages :   package ‘/Users/mahmoudteaima/Downloads/bear_2.7.5.tgz’ is not available (for R version 3.2.3)

please advise me on what to do.

Greetings.

Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post! [Helmut]

Mahmoud Teaima, PhD.
yjlee168
★★★

Kaohsiung, Taiwan,
2016-02-08 10:51
(1751 d 07:16 ago)

@ mahmoud-teaima
Posting: # 15945
Views: 26,906

## Installation problems with bear?

Dear mahmoud-teaima,

» i have installed R 3.2.3 and using Rstudio 0.99.491.dmg, i also installed gfortran4.2.3 and XQuartz2.7.8.

OK. Now you need to go here to download the file preinst.r first. And place this file to your working directory (default one is your Home directory). Then open R and type source("preinst.r") (Enter) and select 'bear' and sit and wait (it may take a while to complete). After it finishes, type 0 to exit. This step is to install all required or dependent packages for bear. Now go to here to download bear_2.7.5.tgz. Now you should be able to install bear under R console/terminal or RStudio with install.packages(file.choose()).

» i did not run bear on my mac before.

Yes, I can figure out that. Good luck.

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mahmoud-teaima
★

2016-02-08 11:19
(1751 d 06:48 ago)

@ yjlee168
Posting: # 15946
Views: 26,866

## Installation problems with bear?

i pasted "prints.r" file at my home directory but i got the following error message
"> R.home()
[1] "/Library/Frameworks/R.framework/Resources"
> source("preinst.r")
Error in file(filename, "r", encoding = encoding) :
cannot open the connection
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
cannot open file 'preinst.r': No such file or directory"

Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post! [Helmut]

Mahmoud Teaima, PhD.
mahmoud-teaima
★

2016-02-08 12:07
(1751 d 06:00 ago)

@ mahmoud-teaima
Posting: # 15947
Views: 26,935

## Installation problems with bear?

sorry for multiple posts.
i did all steps but i'm stuck at the step of installing the binary package from inside the Rstudio, i always get the following error message
"install.packages(file.choose())
Installing package into ‘/Users/mahmoudteaima/Library/R/3.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/Users/mahmoudteaima/Downloads/bear_2.7.5.tgz’ is not available (for R version 3.2.3)
> install.packages(file.choose())
Installing package into ‘/Users/mahmoudteaima/Library/R/3.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/Users/mahmoudteaima/Downloads/bear_2.7.5.tgz’ is not available (for R version 3.2.3)
> install.packages(file.choose())
Installing package into ‘/Users/mahmoudteaima/Library/R/3.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/Users/mahmoudteaima/bear_2.7.5.tgz’ is not available (for R version 3.2.3)
> .libPaths()
[1] "/Users/mahmoudteaima/Library/R/3.2/library"
[2] "/Library/Frameworks/R.framework/Versions/3.2/Resources/library"
> install.packages(file.choose(),lib=/Library/Frameworks/R.framework/Versions/3.2/Resources/library)
Error: unexpected '/' in "install.packages(file.choose(),lib=/"
> setwd("/Library/Frameworks/R.framework/Versions/3.2/Resources/library")
> install.packages(file.choose())
Installing package into ‘/Users/mahmoudteaima/Library/R/3.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/Users/mahmoudteaima/Downloads/bear_2.7.5.tgz’ is not available (for R version 3.2.3)
> install.packages(file.choose())
Installing package into ‘/Users/mahmoudteaima/Library/R/3.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/bear_2.7.5.tgz’ is not available (for R version 3.2.3)
> install.packages(file.choose())
Installing package into ‘/Users/mahmoudteaima/Library/R/3.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/bear_2.7.5.tgz’ is not available (for R version 3.2.3)"

where i should place the bear_2.7.5.tgz file to use it in the installation step?
how i specify the library for the installation?

thanks a lot for you support.

Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post! You can edit your post for 24 hours. Please do so. [Helmut]

Mahmoud Teaima, PhD.
yjlee168
★★★

Kaohsiung, Taiwan,
2016-02-08 13:39
(1751 d 04:28 ago)

@ mahmoud-teaima
Posting: # 15949
Views: 26,806

## Installation problems with bear?

Dear mahmoud-teaima,

OK. You can install bear from a terminal (forget RStudio) under Mac OSX. Go to the download folder and type sudo R CMD INSTALL bear_2.7.5.tgz (Enter). It should work if you have already installed R and its related development tools and libraries.

» Warning in install.packages :
» package ‘/Users/mahmoudteaima/Downloads/bear_2.7.5.tgz’ is not available (for R version 3.2.3)

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
yjlee168
★★★

Kaohsiung, Taiwan,
2016-02-08 13:32
(1751 d 04:35 ago)

@ mahmoud-teaima
Posting: # 15948
Views: 26,762

## Installation problems with bear?

Dear mahmoud-teaima,

No, not R.home(). Type getwd() under R console to find out what the working directory is.

» "> R.home()
» [1] "/Library/Frameworks/R.framework/Resources"
» [...]

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mahmoud-teaima
★

2016-02-08 13:53
(1751 d 04:15 ago)

(edited by Ohlbe on 2016-02-08 18:48)
@ yjlee168
Posting: # 15950
Views: 26,929

## Installation problems with bear?

sorry, that is what i had after repeating your instructions.
"> getwd()
[1] "/Users/mahmoudteaima"
> source("preinst.r")

*** v1.3 (released on Jan. 04, 2016)***

This R script will update all your currently installed R packages
and install required packages for (0 to exit!):-

1: bear
2: ivivc
3: PKfit
4: stab
5: tdm

Selection: 1

If the following package installations fail, please browse
Press Enter to continue.

--> Done. Now please install bear from a binary file.

*** v1.3 (released on Jan. 04, 2016)***

This R script will update all your currently installed R packages
and install required packages for (0 to exit!):-

1: bear
2: ivivc
3: PKfit
4: stab
5: tdm

Selection: 0

Bye now.

> install.packages(file.choose()).
Error: unexpected symbol in "install.packages(file.choose())."
> install.packages(file.choose())
Installing package into ‘/Users/mahmoudteaima/Library/R/3.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/Users/mahmoudteaima/bear_2.7.5.tgz’ is not available (for R version 3.2.3)"

Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post! [Ohlbe]

Mahmoud Teaima, PhD.
yjlee168
★★★

Kaohsiung, Taiwan,
2016-02-08 14:00
(1751 d 04:07 ago)

@ mahmoud-teaima
Posting: # 15951
Views: 26,816

## Installation problems with bear?

Dear mahmoud-teaima,

I suggest that the following step should be done in a terminal (not under R!). Open a terminal and type sudo R CMD INSTALL bear_2.7.5.tgz (Enter). Make sure that you have bear_2.7.5.tgz in the current folder when opening a terminal.

» > install.packages(file.choose()).

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mahmoud-teaima
★

2016-02-08 14:22
(1751 d 03:45 ago)

@ yjlee168
Posting: # 15952
Views: 26,756

## Installation problems with bear?

» finally i did it and installed it fro source by the sun R CMD at terminal.
Thanks a lot for your help and support.

i want to ask, is there a similar package that make the whole calculations of PK parameters e.g. Cmax, tmax, AUC(0-t), AUC(0-inf) and the subsequent statistical ANOVA comparison between test and reference products?. i wish there is.

Greetings.

Mahmoud Teaima, PhD.
yjlee168
★★★

Kaohsiung, Taiwan,
2016-02-08 14:32
(1751 d 03:35 ago)

@ mahmoud-teaima
Posting: # 15953
Views: 26,752

## bear?

Dear mahmoud-teaima,

» finally i did it...

Great.

» i want to ask, is there a similar package that make the whole calculations of PK parameters e.g. Cmax, tmax, AUC(0-t), AUC(0-inf) and the subsequent statistical ANOVA comparison between test and reference products?

Yes, I think bear can do all these (2x2x2 BE study). Please try to run a demo to see if it fits your needs.

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mahmoud-teaima
★

2016-02-08 14:35
(1751 d 03:32 ago)

(edited by Ohlbe on 2016-02-08 18:47)
@ yjlee168
Posting: # 15954
Views: 26,805

## bear?

How can i run a demo for bear on my mac? please advise.

Greetings.

Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post! [Ohlbe]

Mahmoud Teaima, PhD.
yjlee168
★★★

Kaohsiung, Taiwan,
2016-02-08 14:49
(1751 d 03:18 ago)

@ mahmoud-teaima
Posting: # 15955
Views: 26,771

## demo run with bear

Dear mahmoud-teaima,

Open R and type library(bear). Then type go(). From the selection menu, select *Edit setup files. Then edit that spreadsheet-like content. Change 'run demo?' Setting from '0' to '1' and 'Study design' as '0' (see the cheat sheet). Press Enter key once after each change. Then click 'close' (not quit). Then select '*Start data analysis' and follow the menu to run.
» How can i run a demo for bear on my mac? please advise.

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mahmoud-teaima
★

2016-02-08 16:00
(1751 d 02:07 ago)

(edited by Ohlbe on 2016-02-08 18:48)
@ yjlee168
Posting: # 15956
Views: 26,768

## demo run with bear

Thanks a lot.
i have some questions?
1) where can i find the cheat sheet?
2) how can i change the inputs as in the demo the no of subjects is only 14?
3) how can i edit the concentrations and time intervals?

Greetings.

Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post! [Ohlbe]

Mahmoud Teaima, PhD.
yjlee168
★★★

Kaohsiung, Taiwan,
2016-02-08 20:14
(1750 d 21:53 ago)

@ mahmoud-teaima
Posting: # 15958
Views: 26,804

## running bear

Dear mahmoud-teaima,

After typing go() and selecting *Edit setup files from the top menu, you will know what to do. The cheat sheet will pop up simultaneously. After finishing editing the setup, click 'close' on that spreadsheet-like content and the cheat sheet will vanish automatically.

» i have some questions?[...]

To run bear with your own data, just go back to the top menu and select *Edit setup files. Enter '0' for run demo? to disable demo run. Then bear will ask for your own data.

Regarding the format of input data file (*.csv), please read this website carefully. You also can select *Export all demo dataset from the top menu, find all these data files in your working directory. From the meaning of file names (focusing on *.csv), you should be able to figure out what they are. If you still have any question about bear, please search this forum first before posting your question. Thank you for using bear.

All the best,
-- Yung-jin Lee
bear v2.8.9:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
mahmoud-teaima
★

2016-02-08 19:28
(1750 d 22:39 ago)

@ yjlee168
Posting: # 15957
Views: 26,724

## use of my own data with bear

thanks for your help.
i need to know how i use my data (plasma conc vs time of subjects)?
i put the data in a .csv file with the correct order of headings, but how i tell the bear to use these data instead of the demo data?

Greetings.

Mahmoud Teaima, PhD.