Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How can I transfer the table titled \'variables\' (that was imported as a csv fi

ID: 3844000 • Letter: H

Question

How can I transfer the table titled 'variables' (that was imported as a csv file) into the knit HTML document (finaldata.rmd) in Rstudio?

RStudio File Edit Code View Plots Session Build Debug Profile Tools Window Help RStudio Data Rrnd CA Knit Import Dataset Ru sert clobal E Murder Data 51 rurder and non-negligent ranslaughter rate per 100,000 population (1976 of 8 variabl data 50 ob es variables of 2 variabl 15 ob es HS G 54 percent high-school graduates C1970) AStudio Source Editor Fre variables. 57 mean number of days with minimum temperature below freezing C1931-1960) in capi Area Variable Variable Description 60 land area in square miles character vector of 2-letter abbreviations for the stat... 1 state abb 61 Source ector of st (in sq les) 63 st with namedxand y giving the appro. state cente omponent 64 U.S. Department of Commerce, Bureau of the Census C1977 Statistical Abstract o 4 state division factor giving state divisions (New England, Middle Atl... 65 s state.name character vector giving the full state names 66 U.S. Department of Commerce Bureau of the Census C1977) County and City Data B 67 6 state region factor giving the region (Northeast. South. North Cent... 68 References 7 statex77 matrix with 50 rows and 8 columns givng the followi... and Wilks A. R. (1988) Th New s Language. Wads e Chambers Becker 8 Popul population 1, 1975 71 9 Income 974 per capita 72 10 literacy 970, p population) teracy 72 Life Exp years (1969 ctancy e exp 12 Murdo murder and non-negligent manslaughter rate per 10 Console R Markdown 13 Hs Grad percent high school graduates (1970) view(variab es) 14 Frost mean number of days with minimum mperature bel. state table -as. data frame(state.abb,state. name, state.region,state.area land a 15 Area n Squa Error in if C! optional) names (value) c nm missing value where TRUE/FALSE needed In addition: Warning messages 1: In 0ps.factorCoptional) not meaningful for factors 2: In if C! optional) namesCvalue) nm the condition has length 1 and only the first element wi ll be used state tables-as data frame(state .abb, state.name, state region, state. area) Error in if optional names (value) nm missing value where TRUE/FALSE needed In addition: Warning messages In Ops. factorCoptional) not meaningful fo r factors 2: In if Cloptional) nanescvalue) as length 1 and only the first element will be used the condition he View(variables) 0096 Thu 4:20 PM a

Explanation / Answer

The short answer is:

KNOW THY getwd()

Do not confuse the working directory of your current R console with the working directory of your R Markdown document (which is the directory of this R Markdown document). When in doubt, print out getwd() where you want to know your working directory (e.g. in *.Rmd). Note R Markdown documents are compiled in separate R sessions to enhance reproducibility, so you current R console has nothing to do with the compilation of the R Markdown documents.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote