fileUrl <- "http://jadi.net/files/iran_it_status_1394_detail_data_jadi_net.tsv"

na.strings="",fileEncoding="UTF-8",
stringsAsFactors=FALSE,skipNul = TRUE)


Error in read.table(file = file, header = header, sep = sep, quote = quote,  :
no lines available in input
invalid input found on input connection    'iran_it_status_1394_detail_data_jadi_net.tsv'


Edit: The dataset has 1217 rows and 33 variables.

names(data) <- c("timestamp","age","sex","birth_province","work_province","experience","education",
"certificate","learn","project","book","language","wish_language","db","desktop_os",
"wish_os","mobile","env","theme","src_ctrl","tab_space","drink","items","device","title",
"org_type","org_emp","income","perk","job_contract","job_type","hour_wage","happy")


for language variable I expect this output:

data[1:3,"language"]


C#, Javascript, R, SQL

Java, C#, Javascript, Objective C, Swift, SQL

C#, SQL

Python Solutions are also welcome

• I'm voting to close this question as off-topic because this is a simple R problem and not data science enough. Jun 24, 2016 at 12:13
• Tough one; since R is so commonly used in data science, I could imagine some basic R questions being OK here, even if they might be somewhat better on Stack Overflow. Jun 24, 2016 at 12:50
• @SeanOwen Useful criterion: If it might be useful to non data-science R users, it should go in Stack Overflow. There's not a single byte of data science in this question. Any R user might want to read a data file like this in. Hence close, move to stack overflow. Jun 26, 2016 at 10:43
• Are there non-data-science R users? anything you'd do with R seems like part of data science to me. I think this is more on-topic for SO, but that's different from blocking it here. Some SEs overlap. People have to do stuff like this to do their data science work. Jun 26, 2016 at 11:22

I am able to load the data set like so:

 dev <- read.table("iran_it_status_1394_detail_data_jadi_net.tsv",
na.strings="",
stringsAsFactors=FALSE, skipNul = TRUE, fill=T, quote="")


Note the removal of the encoding (so that the function "finds" lines in the file), the fill attribute (to allow for a ragged table with empty cells), and the elimination of quotes (apparently there is a misquoted line somewhere near line 585).

This results in a table full of encoded characters - you'll need to know more about the source data to figure out how to work with it, but if you open the file up in a raw text editor (e.g.: Sublime text) you might get some clues:

• Please see my edit. Jun 24, 2016 at 13:13
• Yes, when using the read.table() call above I get 1217 observations of 33 variables Jun 24, 2016 at 16:52
• The data is loaded by your script but there is a problem with one of my text variables: language . see my edit. Jun 25, 2016 at 15:56
• It doesn't necessarily solve the character encoding issues, but I realized that "#" is the default comment character; comment processing should be ignored: dev <- read.table("iran_it_status_1394_detail_data_jadi_net.tsv", header=TRUE, sep="\t", na.strings="", encoding="UTF-8", stringsAsFactors=FALSE, skipNul = TRUE, fill=T, quote="", comment.char="") Jun 26, 2016 at 1:31
• You are right. Now C# is read correctly but there are extra \" at the beginning and the end of my strings. Jun 27, 2016 at 15:18

Try using eithertry or tryCatch:

See here http://stackoverflow.com/questions/13613270/how-to-fix-the-error-in-r-of-no-lines-available-in-input

• I don't know how to integrate it with my code. Jun 24, 2016 at 13:16