Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False negative format detection by R script with relative data path #20

Closed
machawk1 opened this issue Aug 13, 2020 · 2 comments
Closed

Comments

@machawk1
Copy link
Member

machawk1 commented Aug 13, 2020

I installed fch via pip but wanted to generate plots, so also ran git clone https://github.com/oduwsdl/FollowerCountHistory in /tmp/.

While my current working directory is /tmp/, I ran fch machawk1 > followers.csv. This created /tmp/followers.csv.

I then moved into the source directory using cd FollowerCountHistory/, ran Rscript twitterFollowerCount.R ../followers.csv, and received an error message with no plots generated:

[1] "Unsupported file type"
Warning message:
In if (ext == "csv") { :
  the condition has length > 1 and only the first element will be used

However, running the same command with an absolute path to the CSV file works, i.e., Rscript twitterFollowerCount.R /tmp/followers.csv generates plots without an error. Further, moving the CSV file into the source directory (mv ../followers.csv ./) and running Rscript twitterFollowerCount.R followers.csv works but adding the relative part of the data path, Rscript twitterFollowerCount.R ./followers.csv causes the same above error.

This is likely an issue with the Rscript trying to detect the file type and choking on anything but the absolute path or the data file in the same directory.

@naumansiddiqui4
Copy link
Member

Used tool library to get file extension.

ext = file_ext(basename(args[1]))
path = dirname(args[1])
Commit Id: 8b48e0d

@naumansiddiqui4
Copy link
Member

Check the previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants