R is good at analyzing data. Many data are provided as JSON from RESTful APIs with an URL. R natively support many data format. For JSON, we can use some libraries. For reading JSON from URL, we can use the “jsonlite” package. In this example, we use an example of fetching BTC prices of last
Read more
Tag: R
Reading Excel xls/xlsx Files in R
Posted onMany useful data are stored in Excel xls or xlsx format files. R is good at doing analysis on top of data. We would then need to import the data to R by reading the xls/xlsx files to be R data frames. In this post, we check how to import data from Excel files to
Read more
.docx/.doc to .odt File Conversion in Command Line in Linux
Posted onWord .docx and .doc files are common for documents commonly generated by MS Word software. We would like to convert them to the more open ODF Open Document .odt files for various cases. This can be done by GUI software tools. If we have a set of many .docx/.doc files, it will be handy if
Read more
Converting Hex to ASCII Using xxd
Posted onStrings are commonly encoded as hexadecimal (hex) strings for various purposes. Hence, it is also common to convert hex strings to its original strings such as an ASCII string. Hex to ASCII string conversion can be done programmatically in many languages. In command line, we can use xxd to convert hex to ASCII string. This
Read more
Linux Kernel 5.4.72 Release
Posted onThis post summarizes Linux Kernel new features, bugfixes and changes in Linux 5.4.72 Release. Linux 5.4.72 Release contains 23 changes, patches or new features. In total, there are 126,508 lines of Linux source code changed/added in Linux 5.4.72 release compared to Linux 5.4 release. To view the source code of Linux 5.4.72 kernel release online,
Read more
Install R and RStudio Desktop in macOS
Posted onWe ever discussed How To Install R and RStudio Desktop in Ubuntu Linux 20.04. In this post, we introduce how to install R and RSTudio Desktop on macOS. Install R environment Install R environment as follows using Homebrew. $ brew install R Then verify that the R environment is installed and ready, by running in
Read more
Installing R and RStudio Desktop in Ubuntu Linux
Posted onWe ever discussed How To Install R and RStudio Server in Ubuntu Linux 20.04. If the purpose is to install a local RStudio IDE instead of a remote RStudio Server, we can install RStudio Desktop. In this post, we introduce how to install R and RStudio Desktop on Ubuntu Linux 20.04. For other Ubuntu version,
Read more
Installing R and RStudio Server in Ubuntu Linux
Posted onR is a language and environment for statistical computing and graphics, providing a wide variety of statistical and graphical techniques. The R environment is open source software under GPL. R has rich software packages and is widely used for statistical analysis. RStudio Server is an R integrated development environment (IDE) that provides many useful features
Read more
Linux Kernel 4.19.70 Release
Posted onThis post summarizes new features, bugfixes and changes in Linux kernel release 4.19.70. Linux 4.19.70 Release contains 95 changes, patches or new features. In total, there are 101,521 lines of Linux source code changed/added in Linux 4.19.70 release compared to Linux 4.19 release. To view the source code of Linux 4.19.70 kernel release online, please
Read more
How to Count the Number of Words in a File in PHP?
Posted onCounting the number of words in a file is useful in many programs. In this post, we will discuss how to count the number of words in a file in a PHP script. In PHP standard library, we have function str_word_count($str) which returns the number of words from a string $str. On the other hand,
Read more
Redirect Feed Links to follow.it using .htaccess
Posted onFeedburner used to a powerful tool for RSS feeds publishing and subscriber management. However, feedburner will unlikely leave its maintenance mode because there has been no new features yet less features for quite some years. But RSS feed is still an important part of the Web supported by many software such as WordPress. follow.it is
Read more
How to do screen recording on Wayland in Linux?
Posted onHow to do screen recording on Wayland in Linux? Many screen recorders do not work on the new Wayland. Using Green Recorder You may try Green Recorder which supports Wayland. Note: Green Recorder is no longer under development by the original author (Please check the project README for more details). It still works well for
Read more
gdb like step by step debugger for Python
Posted onAny good debugger for Python that is like gdb so that the code can be executed step by step for debugging purpose? You might check pdb. You can debug a program such as prog.py by invoking it through pdb: python -m pdb prog.py Common gdb commands can be found in pdb: (Pdb) h Documented commands
Read more
How to search history commands very effectively in bash shell command line?
Posted onHow to search history commands very effectively in bash shell command line? Just enter CTRL+r The function of above is: (reverse-i-search)`’: It is very fast and efficient.
Cannot make directory ‘/var/run/screen/S-apache’: Permission denied
Posted onHello! Im trying to create a screen folder for the user apache, Not root. But it seems to fail, I have no idea on how to fix this issue. I only get the error: Cannot make directory ‘/var/run/screen/S-apache’: Permission denied Im using Cent OS 7 There may be various possible reasons. 2 common reasons: screen
Read more
How to split a gzip file to several small ones on Linux?
Posted onI have a very large (e.g. 100GB) .gz file and would like to split it into smaller files like 8GB/each for storage/copying. How to split a gzip file to several small ones on Linux? You may use the tool split to split a file by sizes. An example to split a large.tgz to at most
Read more
How to process a file line by line in PHP?
Posted onIn PHP, how to process a file line by line? The file is a plain text line like input.txt. As an example, the process can be to just print it out. In PHP, you can use this code snippet to process a file line by line: if ( ($fhandle = fopen(“./input.txt”, “r”) !== FALSE )
Read more
How to process a file line by line in Python?
Posted onIn Python, how to process read a file line by line to process it? Like those lines in Bash: while read line ; do echo $line done < ./input.txt In Python, you can process a file line by line by a for in the file like with open(“./input.txt”, “r”) as thefile: for line in thefile:
Read more
How to remove the bottom panel in gnome 3 classic?
Posted onThe gnome 3 classic’s bottom panel looks not useful to me. I do not use it. How to remove the bottom panel in gnome 3 classic? That bottom panel is from the “Window List” plugin. The gnome 3 classic package depends on that plugin package on CentOS 7 as far as I checked. And Gnome
Read more
How to redirect non-www domain to www domain in .htaccess?
Posted onI have a website. But I would like use the www.example.com instead of example.com. How to redirect non-www domain to www domain on my server? I am using apache2 (httpd). You can add a piece of code into the top .htaccess in your site: Specific method: redirect example.com domain to www.example.com domain RewriteEngine On RewriteBase
Read more