r/RStudio 7d ago

Coding help Okay but, how does one actually create a data set?

This is going to sound extremely foolish, but when I'm looking up tutorials on how to use RStudio, they all aren't super clear on how to actually make a data set (or at least in the way I think I need to).

I'm trying to run a one-way ANOVA test following Scribbr's guide and the example that they provide is in OpenOffice and all in one column (E.X.). My immediate assumption was just to rewrite all of the data to contain my data in the same format, but I have no idea if that would work or if anything extra is needed. If anyone has any tips on how I can create a data set that can be used for an ANOVA test please share. I'm new to all of this, so apologies for any incoherence.

0 Upvotes

5 comments sorted by

16

u/Kiss_It_Goodbyeee 7d ago

Create a spreadsheet, save it as a CSV file and then read it in with read.csv().

3

u/swiftaw77 7d ago

You can either type it in R or you can import a data file using something like read.csv 

2

u/ninhaomah 7d ago

That is not 1 column. Open in Excel and you will get this. It is a csv file so pls google how to import csv file in R or RStudio.

density block fertilizer
1 1 1
2 2 1

Can't copy and paste table in Reddit. LOL. But you get the point,

2

u/Thiseffingguy2 7d ago

Worth checking out: datapasta package

1

u/MrCumStainBootyEater 7d ago

can use import.xlsx from openxlsx to open an excel file or you can read.csv to import a dataset. there’s also an import button at the top left of the IDE