0

I would like to run job using R. I wrote r script as follow

#!/bin/sh
#SBATCH --time=168:00:00
#SBATCH --mem=50gb
#SBATCH --ntasks=1
#SBATCH --job-name=StrAuto
#SBATCH --error=R.%J.err
#SBATCH --output=R.%J.out
#SBATCH --mail-type=ALL
#SBATCH --mail-user=asallam@unl.edu
module load R/3.3
R CMD BATCH AF1.R

Then I worte the command lines in AF1.R file as follow

outer(names(m[,-1]), names(m[,-1]), function(x,y){colSums((m[,x]-m[,y])**2/156854,na.rm=TRUE)})

Now I would like to ask how I load my data m.txt. what is the command that I should write before outer(.......

Thanks in advance

nbryans
  • 1,507
  • 17
  • 24
  • 1
    Is this question about batching R or how to read some structured text file? It's a little unclear, and it would help if you make this a [reproducible question](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – r2evans Mar 12 '17 at 04:35
  • Thanks for your reply. I have three files. The first file is a script of submitting the job in our computer center and this file with extension txt. The second one is r code with an extension of . R (in above it is AF1.R). This file includes the command which I would like to run in my data. The third file is my data which is m.txt. – Ahmed Sallam Mar 12 '17 at 04:44
  • 1
    Read the link I provided. Knowing that there is a file tells me nothing about the structure or anything else. I suggest you search for questions (here on StackOverflow) pertaining to importing files of different formats. If you really cannot find what you want (and please spend more than 5 minutes search), then read the link about generating reproducible questions. Here's another link, provided within StackOverflow help, about [minimal, verifiable examples](http://stackoverflow.com/help/mcve). Without a little more detail, your question may be closed for being too vague. – r2evans Mar 12 '17 at 04:51

0 Answers0