Introduction to R Environment and Basic Commands
摘要
This chapter introduces the R environment and the basics of coding in R, focusing on life sciences and medical research applications. It begins with the installation process of R and RStudio, an integrated development environment (IDE) that enhances coding efficiency. The chapter covers the structure of RStudio’s graphical user interface (GUI), including the Source, Console, Environment, and Files/Plots windows, each serving distinct purposes in writing, executing, and managing R code. Additionally, the chapter covers data types such as numeric, integer, character, logical, and factors, explaining how to create and manipulate these data structures using R’s built-in functions. The concept of vectors, matrices, and lists as fundamental data structures is explained, along with methods for subsetting and performing operations on them. This foundational chapter prepares readers for more advanced data analysis, emphasizing the versatility of R in handling and analyzing research data.