Number of rows read and used

31 views
Skip to first unread message

Paul o Reilly

unread,
Oct 24, 2013, 7:32:54 AM10/24/13
to random...@googlegroups.com
Hello,

I am very new to using rjungle.

I prepared my data as described in the manual

write.table(file,"file.dat",row.names=FALSE,quote=FALSE)

When the jungle begins it says it reads 7921 rows and 19191 columns. It then says using 15842 rows and 19192 columns. I am a bit worried as the file should only contain max 109 rows.

Any and all help would be appreciated. Apologies in advance if how I have presented this problem is sloppy etc.

Yours
Paul

Jochen Kruppa

unread,
Oct 24, 2013, 7:46:26 AM10/24/13
to jorgmu...@gmail.com, randomjungle
Hi,

first of all could you please attach the log-file? This would help or
send the output of random jungle printed at your screen.

What gives you str(file) in R?

Best

Jochen

2013/10/24 Paul o Reilly <jorgmu...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "randomjungle" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to randomjungle...@googlegroups.com.
> To post to this group, send email to random...@googlegroups.com.
> Visit this group at http://groups.google.com/group/randomjungle.
> For more options, visit https://groups.google.com/groups/opt_out.

Paul o Reilly

unread,
Oct 24, 2013, 8:24:42 AM10/24/13
to random...@googlegroups.com
Hello Jochen,

I have attached the log for the run.

The data was originally prepared in Excel, exported as .csv and then read into R.
rjungle1.log

Jochen Kruppa

unread,
Oct 24, 2013, 8:48:12 AM10/24/13
to Paul o Reilly, randomjungle
Okay.

Could you please do

str(file)

in R? Than you will get the information on the read in data. And then
you will see if the error is before or after writing the data to a
file.

Thanls

2013/10/24 Paul o Reilly <jorgmu...@gmail.com>:

Paul o Reilly

unread,
Oct 24, 2013, 10:34:44 AM10/24/13
to Jochen Kruppa, random...@googlegroups.com
So I did the str(file) and received the following included below (truncated for space purposes). The 89 levels would correspond with the number of cell lines I have in the analysis. As you can imagine I would of expected therefore to have 89 rows but I am likely misunderstanding something very simple

data.frame':    7745 obs. of  19191 variables:
 $ V1    : Factor w/ 3 levels "Resistant","Sensitive",..: 3 1 1 1 1 1 1 1 1 1 ...
 $ V2    : Factor w/ 89 levels "6.044366095",..: 89 25 79 31 61 34 5 74 24 72 ...
 $ V3    : Factor w/ 89 levels "3.599862534",..: 89 35 8 47 46 29 31 40 41 66 ...
 $ V4    : Factor w/ 89 levels "3.281474756",..: 89 86 37 74 88 84 6 33 44 25 ...
 $ V5    : Factor w/ 89 levels "10.00153092",..: 89 43 56 21 85 66 58 5 60 63 ...
 $ V6    : Factor w/ 89 levels "10.01158712",..: 89 56 15 19 60 9 6 30 71 39 ...
 $ V7    : Factor w/ 89 levels "5.864544318",..: 89 44 76 59 11 77 40 56 55 80 ...
 $ V8    : Factor w/ 89 levels "4.056955608",..: 89 67 32 62 18 69 77 75 37 57 ...
 $ V9    : Factor w/ 89 levels "4.025692394",..: 89 26 40 32 1 47 6 29 51 52 ...
 $ V10   : Factor w/ 89 levels "6.299343154",..: 89 24 37 78 8 2 16 70 14 34 ...
 $ V11   : Factor w/ 89 levels "4.882376441",..: 89 44 54 42 22 39 38 27 70 75 ...
 $ V12   : Factor w/ 89 levels "4.401860956",..: 89 52 58 23 15 18 36 66 87 50 ...
 $ V13   : Factor w/ 89 levels "7.570421765",..: 89 44 54 85 70 50 40 60 32 46 ...
 $ V14   : Factor w/ 89 levels "5.76202287","5.960870546",..: 89 31 64 18 19 16 80 37 84 47 ...
 $ V15   : Factor w/ 89 levels "6.404455042",..: 89 32 42 23 19 48 18 57 45 43 ...
 $ V16   : Factor w/ 89 levels "5.269175633",..: 89 33 3 30 83 37 10 38 34 80 ...
 $ V17   : Factor w/ 89 levels "10.00625057",..: 89 87 63 20 72 18 74 51 31 24 ...
 $ V18   : Factor w/ 89 levels "3.575507295",..: 89 63 12 83 58 40 81 79 29 71 ...
 $ V19   : Factor w/ 89 levels "4.815023884",..: 89 33 75 80 60 27 24 83 34 42 ...
 $ V20   : Factor w/ 89 levels "5.108628274",..: 89 77 25 32 84 26 55 47 12 85 ...

 $ V87   : Factor w/ 89 levels "4.818705842",..: 89 30 56 85 28 21 50 53 58 29 ...
 $ V88   : Factor w/ 89 levels "8.589599802",..: 89 51 18 48 73 82 33 38 40 74 ...
 $ V89   : Factor w/ 89 levels "3.080587385",..: 89 11 49 75 46 20 53 21 12 71 ...

Jochen Kruppa

unread,
Oct 24, 2013, 10:46:21 AM10/24/13
to Paul o Reilly, randomjungle
Hi Paul,

as you can see you have 7745 observations and 19191 variables. You
should read in your data with stringAsFactor=FALSE to get rid of the
factors. More see: ?read.table therefore it should be ervything okay,
so far...

Visit Quick R and the data section for more information. Quick R is a
good start to get familiar with R. Good luck!

http://www.statmethods.net/input/importingdata.html

Best wishes

Jochen

Paul o Reilly

unread,
Oct 24, 2013, 10:49:06 AM10/24/13
to random...@googlegroups.com
I will try this thank you very much for the advice and tips :)


On Thursday, October 24, 2013 12:32:54 PM UTC+1, Paul o Reilly wrote:

Paul o Reilly

unread,
Oct 25, 2013, 1:28:15 PM10/25/13
to Mollon, Jennifer, random...@googlegroups.com
Hi Jennifer,

Sorry I did not reply sooner I had a busy day today, It's such a relief that yourself and Jochen have both suggested similar seemingly easy solutions. I am eager to give it a go tomorrow morning and get me some sweet data :)

Paul



On Thu, Oct 24, 2013 at 3:51 PM, Mollon, Jennifer <jennife...@kcl.ac.uk> wrote:
Hi Paul - I've been following your conversation here.  I use R and have used Random Jungle, so I might be able to help you if you're struggling.  I'm going to be looking at some posters now, but happy to meet up at lunch or later today/tomorrow if you want some help.

Your current problem is that you have a matrix that is 7745 rows x19191 columns, not 89 rows.  R has converted your numeric variables to factors - a nasty habit it has.  When you're reading data, do something like this:

read.table("file", header=T, as.is=T)

The part in bold will stop R converting things to factors.

Jen

Jennifer Mollon
Post-Doctoral Research Associate
NIHR Biomedical Research Centre for Mental Health
South London and Maudsley NHS Foundation Trust &
Institute of Psychiatry, Kings College London
Box P080
De Crespigny Park
London SE5 8AF

http://core.brc.iop.kcl.ac.uk


On 24 Oct 2013, at 10:34, Paul o Reilly <jorgmu...@gmail.com>
 wrote:
Reply all
Reply to author
Forward
0 new messages