I have a script written on Basic, that get on input CSV-file and compute collision between random splitting of input data. This script is here. I need to reimplement it on R. I've written such script. Here is input data.
But in condition
if(nentries==nrows*ncolumns)
{
print("Columns, rows, and entries check; we're good to go.")
}
else
{
print("Columns, rows, and entries don't check; please look at your data file to make sure each line has equal no. of entries.")
}
appear error
source("path\\to\\script.r")
error in source("path\\to\\script.r") :
D:\projects\basicToR\target.r:19:1: Unexpected 'else'
18: }
19: else
^
Why is the error here? And is there other errors in R file?
UPDATE I've forgotten write in question about error
Error in seq.default(1, firstsofar, 1) : Invalid sign 'by' argument
in fragment of code
for (q in seq(1,firstsofar,1)) {
if( randnum[i]==randnum[q]) {taken="yes"}
}