R vs python

Representing Data in R – Python equivalent import pandas as pd import numpy as np # 'characters' is equivalent to string firstName = 'jeff' print((type(firstName), firstName)) <type 'str'> jeff # 'numeric' is equivalent to float heightCM = 188.2 print((type(heightCM), heightCM)) <type 'float'> 188.2 # integer is equivalent to integer numberSons = 1 print((type(numberSons), numberSons)) <type 'int'> 1 # 'logical' is equivalent to Boolean teachingCoursera = True print((type(teachingCoursera), teachingCoursera)) <type 'bool'> True # 'vectors' is equivalent to numpy array or Python list (I will use array everywhere for consistency) heights = np.

Continue reading

purrr: adverb

What is an adverb Read carefully the purrr documentation Adverbs modify the action of a function ; taking a function as input and returning a function with modified action as output. In other words, adverbs take a function, and return this function modified. Yes, just an adverb modifies a verb. library(purrr) safe_log <- safely(log)#high-order functions safe_log("a") ## $result ## NULL ## ## $error ## <simpleError in log(x = x, base = base): non-numeric argument to mathematical function> # have a result and error how to write your own?

Continue reading

why reproducible The fundamental idea behind a robust, reproducible analysis is a clean, repeatable script-based workflow (i.e. the sequence of tasks from the start to the end of a project) that links raw data through to clean data and to final analysis outputs. principles of a good analysis workflow Any cleaning, merging, transforming, etc. of data should be done in scripts, not manually. Split your workflow (scripts) into logical thematic units.

Continue reading

Q: I has many separate tables that need to be combined into a single file? google search “R read many datasets or tables” Three steps: Getting a list of files path to read Write a function to read a file Then loop it step01: list all files path library(here) allfiles = list.files(path = here("data"), #Use the ⭐here package to indicate the directory the files are in relative to the root directory pattern = "AB.

Continue reading

How to build shiny app from scratch in R? You can build web page (online reporting tool) without knowing any web programming languages such as Javascript / PHP / CSS. The best part about shiny package is that you can easily integrate R with webpage. Suppose you want your web page run machine learning algorithms like random forest, SVM etc and display summary of the model with the flexibility of selecting inputs from user.

Continue reading

R is mainly known for data analysis, statistical modeling and visualization. While python is popular for deep learning and natural language processing. Python and R were ranked top 2 tools for data science and machine learning. If you really want to boost your career in data science world, these are the languages you need to focus on. How To Call Or Run Python From R? RStudio developed a package called reticulate which provides a medium to run Python packages and functions from R.

Continue reading

The NCBI is one of the most important sources of biological data. The centre provides access to information on 28 million scholarly articles through PubMed and 250 million DNA sequences through GenBank. More importantly, records in the [50 public databases] (https://www.ncbi.nlm.nih.gov/guide/all/#databases) maintained by the NCBI are strongly cross-referenced. As a result, it is possible to pinpoint searches using almost 2 million taxonomic names or a controlled vocabulary with 270,000 terms.

Continue reading

Author's picture

Jixing Liu

Reading And Writing

Data Scientist

China