Wednesday, February 15, 2017

Error : package ‘rgl’ was built before R 3.0.0: please re-install it (Ubuntu)

Error : package ‘rgl’ was built before R 3.0.0: please re-install it

Solution:
Open Terminal and type as below
$ sudo apt-get install libX11-dev freeglut3 freeglut3-dev

$ sudo apt-get update
$ sudo apt-get upgrade

Then switch to R (type R) from Terminal or open RStudio and type as below
install.packages("rgl")

That's it.

Saturday, October 25, 2014

How to Install Netbeans IDE 8.01 on Ubuntu

After a long while with Netbeans IDE 7.4, I decided upgrade to new released version of Netbeans IDE 8.0.1.  Here I give some recommended steps before install IDE 8.0.1 on your Ubuntu Linux OS. 

1. Uninstall previous version of Netbeans: Your default "uninstall.sh" file in the /home/userName/Netbeans7.x.x folder is doing this job. 


2. Update your JRE and JDK: Before update, enter "java -version" into terminal to check your current version of JAVA.


3. To install OpenJDK 7, execute the following command:
sudo apt-get install openjdk-7-jre 
This will install the Java Runtime Environment (JRE). 
4. If you instead need the Java Development Kit (JDK), execute the following command:
sudo apt-get install openjdk-7-jdk
5. Run "netbeans-8.0.1-linux.sh" through the terminal.


Monday, March 24, 2014

The requested URL /phpmyadmin was not found on this server. Apache/2.2.22 (Ubuntu) Server at localhost Port 80

The problem is that the required line in the Apache configuration file that can serve webpages for phpmyadmin is not included. Here are some commands you should type in terminal to fix this:

 sudo dpkg-reconfigure -plow phpmyadmin

This command configures the installation of phpmyadmin and copy the file for phpmyadmin to the correct path. Then check again the configuration.

 grep phpmyadmin /etc/apache2/apache2.conf

And reload apache again

 sudo /etc/init.d/apache2 reload

 If the all commands above is unsuccessful, type the following commands:
 sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
 sudo /etc/init.d/apache2 reload

 And check your browser one more time: localhost/phpmyadmin It should work....

Sunday, February 16, 2014

xtable in knitr

xtable in knitr
Here i am going to give an example of xtable package in knitr. We use cars data which comes default through the R
The summary data of cars:
summary(cars)
##      speed           dist    
##  Min.   : 4.0   Min.   :  2  
##  1st Qu.:12.0   1st Qu.: 26  
##  Median :15.0   Median : 36  
##  Mean   :15.4   Mean   : 43  
##  3rd Qu.:19.0   3rd Qu.: 56  
##  Max.   :25.0   Max.   :120
```{r table1, results='asis'} 
library(xtable)
data(cars)
print(xtable(summary(cars), caption = "Cars Data",
floating = FALSE, label = "tab:coef"), type = "html", include.rownames = F)
```
library(xtable)
data(cars)
print(xtable(summary(cars), caption = "Cars Data", floating = FALSE, label = "tab:coef"), 
    type = "html", include.rownames = F)
Cars Data
speed dist
Min. : 4.0 Min. : 2
1st Qu.:12.0 1st Qu.: 26
Median :15.0 Median : 36
Mean :15.4 Mean : 43
3rd Qu.:19.0 3rd Qu.: 56
Max. :25.0 Max. :120
The outcome in your html file is:
## <!-- html table generated in R 2.15.1 by xtable 1.7-1 package -->
## <!-- Sun Feb 16 23:55:02 2014 -->
## <TABLE border=1>
## <CAPTION ALIGN="bottom"> Cars Data </CAPTION>
## <TR> <TH>     speed </TH> <TH>      dist </TH>  </TR>
##   <TR> <TD> Min.   : 4.0   </TD> <TD> Min.   :  2   </TD> </TR>
##   <TR> <TD> 1st Qu.:12.0   </TD> <TD> 1st Qu.: 26   </TD> </TR>
##   <TR> <TD> Median :15.0   </TD> <TD> Median : 36   </TD> </TR>
##   <TR> <TD> Mean   :15.4   </TD> <TD> Mean   : 43   </TD> </TR>
##   <TR> <TD> 3rd Qu.:19.0   </TD> <TD> 3rd Qu.: 56   </TD> </TR>
##   <TR> <TD> Max.   :25.0   </TD> <TD> Max.   :120   </TD> </TR>
##    <A NAME=tab:coef></A>
## </TABLE>
The rest, you are able to add some style by using CSS…

Wednesday, February 12, 2014

How to upgrade R version on Ubuntu

There are lots of directives on the web how to upgrade R version or installing the latest version of R. Here I am going to tell the clearest and success way that I have done.

Open your terminal (Ctrl+Alt+T) 
1. Uninstall current R version on your system
sudo apt-get remove r-base-core
2. Add cran.rstudio deb to sources.list
sudo nano /etc/apt/sources.list    
Paste the below code in to your sources.list
deb http://cran.rstudio.com/bin/linux/ubuntu precise/
My version is "precise".  That's why the line ends with "precise". You can learn your Ubuntu version:
lsb_release -a
Codename is your version....

3. Add key to sign CRAN packages
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
4. Add PPA (for CRAN) to your system
sudo add-apt-repository ppa:marutter/rdev
sudo apt-get update
sudo apt-get upgrade
5. Install R again 
sudo apt-get install r-base
If you want to check the version of your R. Open terminal, enter R and type:
version
That's all.....

Tuesday, January 14, 2014

The Full Compilation Cycle In TeXMaker

As you know, we have to run pdflatex twice afterwards to get the document fully compiled. To run pdflatex at once causes a problem to compile \tableofcontents or \bibliography. If you want to be able to perform the full compilation cycle and view the finished *.pdf file, you have to do some sort of things:
  • click "Options" menuitem on TexMaker menubar
  • choose "Configure Texmaker"
  • choose "Quick Build" dialog from the pane on left hand side
  • click "Wizard" button
  • and choose the following sequence:
    1. PdfLaTeX
    2. Bibtex
    3. PdfLaTex
    4. PdfLaTex
    5. Pdf Viewer
Afterwards, to view your finished *.pdf file, just press F1