Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can you help me to load a Sample file in the R program , can you re write the code ? Function read.table () is
Can you help me to load a Sample file in the R program , can you re write the code ?
Function read.table () is one of the base R functions for reading text files. The first argument of theses functions is the name of the file from which you want to import data. However, these functions allow you to specify as the filename a special string - "clipboard". With this "filename" these functions will read the data from the contents of the clipboard into a data frame. In the above example we are assuming that we have selected and copied a range that included the column names in the first row and thus the header=TRUE argument. Sometimes we may need a few more tweaks of the parameters of the read.table() function, but it should be straightforward most of the times. Please note that you can not use this special filename with the functions from package readr that we have explored before. For larger data tables stored in Excel the usage of the clipboard may not be so convenient. For such situations the package readxl (Wickham, 2015a) contains a function named read_excel() that is very handy. The following is an example of its usage: > library (readxl) > fc \\ Documents and Settings \\xpto\\My Documents \\calc.xls" > dat R4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started