将数据帧转换为R中的矩阵

时间:2016-04-05 07:29:56

标签: r

我是R的初学者。

我在数据框中有这样的输入:

PlatformUI.getWorkbench().getProgressService().run(true, true, new IRunnableWithProgress() {
            @Override
            public void run(final IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
    progressMonitor.beginTask("Start Job", 1);
         Job job = new Job("Job1") {

            @Override
            protected IStatus run(IProgressMonitor dummyMonitor) {
                //Use monitor of progressive service
                progressMonitor.beginTask("Started Job1", no_of_tasks);
                //Perform Job and update monitor once task is done
            }
            @Override
            public boolean belongsTo(Object family) {
                return family == BuildConstants.MY_JOB_FAMILY;
            }
         });
     }
    job.setUser(false);
    job.schedule();
    //Wait for Job to be done
    IJobManager jobManager = Job.getJobManager();
    Job[] jobs = jobManager.find(BuildConstants.MY_JOB_FAMILY);

    while(jobs.length > 0) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            //Do nothing.
        }
        jobs = jobManager.find(BuildConstants.MY_JOB_FAMILY);
    }
    //Once job finishes exit the Progressive service. 
});
}

我想将其转换为如下矩阵:

> str(new.dataframe)
'data.frame':   86 obs. of  15 variables:
 $ U89355_at       : num  66.8 84.6 136.4 105 103 ...
 $ U01877_at       : num  408 306 370 449 268 ...
 $ X84709_at       : num  318 636 1005 427 462 ...
 $ M58603_at       : num  942 616 730 592 566 ...
 $ M69043_at       : num  3479 1735 5544 1842 2243 ...
 $ L19067_at       : num  688 1012 1238 753 656 ...
 $ U33838_at       : num  -27.3 7.5 22 24 -8 -27.2 -36 -11.1 -34.8 23 ...
 $ U33838_s_at     : num  176 312 426 305 216 ...
 $ Z22951_rna1_s_at: num  438 854 937 572 480 ...
 $ M58286_s_at     : num  961 851 252 1149 1361 ...
 $ M32315_at       : num  716 466 460 819 589 ...
 $ X02910_at       : num  39.8 62.7 37.8 48.5 57 75.9 55.1 32 22 5.4 ...
 $ L41690_at       : num  546 1246 652 913 602 ...
 $ U78798_at       : num  61.4 91 118 165.1 95 ...
 $ U50062_at       : num  125 226 185 251 200 ...

希望有人可以提供帮助。谢谢。

0 个答案:

没有答案