Rstudio descriptive statistics10/21/2023 ![]() Below is a sample data frame, but I cannot get the factor to be evenly distributed in their respective columns (Sorry). Also due to my limited knowledge of R, I cannot make a perfect data frame. Unfortunately, I cannot attach sample data for testing. Since I cannot attach sample data and my coding is very basic, here is what I could come up with: here is the borrowed code: SEM <- function(x) sd(x)/sqrt(length(x)) I know SEM is not a standard function in most packages thus, I borrowed this function from an answer on stack overflow because I do not know how to create functions.I do not like their table styles and they do not all have the option to just show N, mean, StDev, SEM, Min, and Max. I've tried qwraps2 to create one and looking into the following packages for something pre-made: psych, stargazer, and HMSIC. Looked in multiple StackOverflow questions and Google searches with no success to find code that works for my particular case.Tried to create a summary table with Var4 as a factor for Var1,Var2, and Var3 (partial success style is not what I want or it is not exportable to excel).Used dplyr and the %>% function to manipulate the data without and with factor Var4 or Var5.(fill in "yoursubfolder" with actual folder name on your computer) Note for MacOS users, path = /Users/admin/yoursubfolder/yoursubfolder. Here is the code needed to export to xlsx using the openxlsx package: write_xlsx(dataframe, path = "C:/Users/user/Desktop"). At the moment, "writexl" package works very well for me as I have problems with "xlsx" and "openxlsx" packages. TXT to be used in Excel for stylistic table edits. Export the summary table (or summary tables if one table is not possible) to xlxs (ideally).Below is a simplified, visual example of the table I am aiming for: ![]() in a tibble or ame format) with 2 sub factors (Var4 and/or Var5) for Var1, Var2, and Var3. Take the subsetted data to create 1 summary table( i.e. Manipulate my data frame using tidyverse to subset my data My data set is time series data with 6 columns that have 50,000+ rows.ĭateTime:POSIXCT format "YYYY-MM-DD HH:MM:SS" I have only found partial answers and my knowledge in R and R packages is still basic enough to limit my progress. I have spent a few weeks looking for solutions to my problem of not only finding but creating a descriptive statistics summary table on my data that is exportable to xlsx (ideally).
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |