Code Monkey home page Code Monkey logo

grea's Introduction

GREA

Build Status

GREA (Gotta Read 'Em All) is an RStudio Add-In assisting to read all popular file formats into R through R base functions and rio. In the beginning, the user selects a file on his/her computer. After some optional adjustments (which are done interactively), the proper function to read the file is pasted into the console, with an object name that can be specified by the user. Supported file formats include Stata (.dta), SPSS (.sav), Matlab (.mat), Excel (.xls, .xlsx) and various text/delimited-formats (.raw, .csv, .txt, .asc, .dat, etc.).

Click here for an interactive comic on why GREA is important.

News

16.05.2016

  • First version of GREA was wrapped up into a package

22.05.2016

  • shiny::fileInput dependency replaced with fileChoose() function

26.05.2016

  • Big structural revamp: Add-In now pastes the proper function to parse the file right into the console!

18.06.2016

  • Now relies heavily on rio, therefore supporting way more filetypes.

21.07.2016

  • New Advanced Options Tab: Adds the ability to
    • Specify own NA values
    • Specify own column separators
    • Skip rows when reading data
    • Encode text-delimited files

Installation

To install the Add-In, run the following code:

devtools::install_github("Stan125/GREA")

Usage

0. Starting the Add-In

Calling the Add-In is simple: just click on the Add-In Tab and select 'Gotta Read Em All'. The Add-In itself quickly pops up and you are good to go!

1. Selecting the dataset

Once the Add-In is started up, press the "Select File" button to select a file on your computer. Then, you can specify a name for your dataset (if blank, the filename, without extension, is used). Once the file is loaded into the Add-In, you may see additional options for parsing the file. Ignore those for now and head right to the "Preview" tab.

#### 2. Looking at the preview

The preview tab shows a preview of what your dataframe would look like if you parsed it with the current settings. If something looks odd (e.g. your column names fell into the first row of the dataset), head back to the first tab. If everything is right, still head back to the first tab.

#### 3. Adjusting stuff

If the preview of your dataframe looked off, you now have the chance to adjust some parameters (e.g. Sheet Index for Excel files, or separator for delimited files). Adjust them so your preview looks exactly like you want them to. When you are finished (and have typed in a name for your newly aquired dataset), press "done". Afterwards, the function to read your dataset is pasted into your console. Boom! You're good to go.

### Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

grea's People

Contributors

leeper avatar stan125 avatar wiep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grea's Issues

Dataset Name validation

The filename that I imported was named something like salmon-x.csv. The auto-suggested name would then be salmon-x which is not a legal R variable name and gets interpreted as a calculation with R complaining that object 'salmon' not found.

The workaround is simple enough, I just overwrote the suggested name.

It might be preferable to replace the '-' character by underscores in the suggested name. Of course there might be other characters such as '+' that are legal in filenames but might not be R-friendly.

It doesn´t parse

Dear sirs,

I´m trying to import a single spreadsheet (attached) and it doesn´t parse at all.
The print screen is also attached.
Thanks for any help in advance!

grea_test
sims_data.xlsx

Depend on rio?

Please take this suggestion with a grain of salt since I am the (co-)author of the package, but why not use rio to handle the file importing? This way you don't need to reimplement all of the complex handling of file types, etc. No pressure, of course.

Problems importing sav files

I've been trying GREA.
It works well with csv files,
but when importing SPSS SAV files I can't get the preview and when I press "Done" I get this error:

Listening on http://127.0.0.1:5670

  1. Wrong options for generating df, or
  2. Outcome is not a df (for Excel and SPSS reader functions)

Though, if I use haven or foreign to import it it works well.

Cannot install - no package called GREA

I've tried installing this with MRO 3.3.0 64bit, R 3.3.0 64bit and 32bit all on Win7. It gives similar errors.
I also tried doing this in Rstudio and the R command prompt. Same errors.

devtools::install_github("Stan125/GREA")
Downloading GitHub repo Stan125/GREA@master
from URL https://api.github.com/repos/Stan125/GREA/zipball/master
Installing GREA
"C:/PROGRA1/R/R-331.0/bin/x64/R" --no-site-file --no-environ --no-save
--no-restore --quiet CMD INSTALL
"C:/Users/[user]/AppData/Local/Temp/Rtmp4Qvf49/devtools2bb019b06959/Stan125-GREA-8eb2b3f"
--library="\clus-file-01/userdirs/[user]/Documents/R/win-library/3.3"
--install-tests

  • installing source package 'GREA' ...
    ** R
    ** inst
    ** tests
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    *** arch - i386
    Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
    there is no package called 'GREA'
    Error: loading failed
    Execution halted
    *** arch - x64
    Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
    there is no package called 'GREA'
    Error: loading failed
    Execution halted
    ERROR: loading failed for 'i386', 'x64'
  • removing '\clus-file-01/userdirs/[user]/Documents/R/win-library/3.3/GREA'
    Error: Command failed (1)

Perhaps it's because my R lib folder is a network share?

I quickly tried installing it on my Ubuntu Mate box, and that worked fine. So I'm pretty sure it's something odd about the setup on my Windows machine.

Na.string format wrong

Importing a CSV file with missing-value placeholders "-99, --"

An examination of the generated command shows
read.table(file = "2022_Ass2Data.csv", sep = ",", dec = ".", header = TRUE, na.strings = "-99,--")
whereas what is required / expected is
read.table(file = "2022_Ass2Data.csv", sep = ",", dec = ".", header = TRUE, na.strings = c("-99","--"))

Clearly, this only works for a single missing value placeholder.

na.strings needs to be string-split into a vector based on ","

Install package failed - unexpected symbol in "Microsoft DiskPart"

After installed all require packages, I run this code:
devtools::install_github("Stan125/GREA")

Here's result

Downloading GitHub repo Stan125/GREA@master
from URL https://api.github.com/repos/Stan125/GREA/zipball/master
Installing GREA
"F:/Programming/R/R-3.3.1/bin/x64/R" --no-site-file --no-environ
--no-save --no-restore --quiet CMD INSTALL "D:/DATA/App
Cache/WindowsTemp/Temp/Rtmp4Aq6YN/devtools35b428f40be/Stan125-GREA-e80db34"
--library="F:/Programming/R/R-3.3.1/library" --install-tests

  • installing source package 'GREA' ...
    ** R
    ** inst
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    *** arch - i386
    ARGUMENT 'Cache\WindowsTemp\Temp\Rtmpwh8yJW\Rin36a86eb36998' ignored

Error: unexpected symbol in "Microsoft DiskPart"
Execution halted
*** arch - x64
ARGUMENT 'Cache\WindowsTemp\Temp\Rtmpwh8yJW\Rin36a878dd7c2a' ignored

Error: unexpected symbol in "Microsoft DiskPart"
Execution halted
ERROR: loading failed for 'i386', 'x64'

  • removing 'F:/Programming/R/R-3.3.1/library/GREA'
    Error: Command failed (1)

Unable to install GREA

Hi Stan -

I followed the instructions to install this addin but got the following error. Can you please help resolve this?

devtools::install_github("Stan125/GREA")
Downloading GitHub repo Stan125/GREA@master
Error in packageVersion("curl") : package ‘curl’ not found

Can you please help resolve this?

Thanks!

about the seperators

Hi Stan125,

thanks a lot for building up this addin.
I'm wondering if you'd like to add one optional function to the seperator which enables one choosing the separator that is not included in your list? I think it would be very helpful for many users.

Best,
meged

Feature Request, Set Variable types

Dear Stan,

I'd like to ask if you can make it possible to set the type per variable with simple drop-down menu, so I can easily set to date, character, numeric, factor, etc. This would be so helpful, as it takes me forever each time.
If additionally I could set the labels interactively aswell, that would be amazing.
Great Work
Best Wishes

Generate code

I think it would be good if your package generated the appropriate code to open the file in a non-interactive mode.

This way, the user doesn't have to go through a interactive process every single time they want to re-run the code. Interactive is good for user experience, especially for novices, but it is more time consuming.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.