[R] R: interpreting weight in meta-analysis of proportion

2014-04-19 Thread Mario Petretta
Fine !

Many many thanks!

Mario


-Messaggio originale-
Da: Bernd Weiss [mailto:bernd.we...@uni-koeln.de] 
Inviato: venerdì 18 aprile 2014 15.58
A: petre...@unina.it; R-help@r-project.org
Oggetto: Re: [R] interpreting weight in meta-analysis of proportion

On 18.04.2014 13:02, petre...@unina.it wrote:
 Prof. Dewey, sorry for the trivial question and many thank for the replay.
 
 
 Using which package?
 
 In this case I used the meta package, but I know that for all but the 
 DerSimonian-Laird method the R function rma.uni of R package metafor 
 is called internally.
 
 What did you expect the weights to sum to, I wonder.
 
 I think that, to better explain the influence of single study in 
 pooling the effect size, the weight are presented as percentage of the 
 sum of total weight of each study, but I ask for a confirm. 
 Nevertheless, I ask if it is possible to obtain for each study the 
 value of the absolute weight, other than the relative weight, or at 
 least the absolute value of the sum of the weights.
 

## This is an example from the examples-section res - metaprop(4:1, c(10,
20, 30, 40), comb.fixed=FALSE, comb.random=TRUE)

## Object res contains a lot of interesting information ## Open ?metaprop
and read the section on values
str(res)

## Obtaining the random-effects weights
res$w.random

## Calculating relative weights manually
res$w.random/(sum(res$w.random))

HTH,

Bernd

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R Example scripts

2014-04-19 Thread Duncan Murdoch

On 18/04/2014, 6:07 PM, Gene Leynes wrote:

A few years ago R changed the way help was handled so that the HTML
files are no longer available in the library directory.  Around that
time the R example files that used to be in some of the libraries also
vanished.

I'm wondering where the r-ex folder went. Is it totally unsupported
and gone? Is it hidden in the mysterious rdx or rdb files?


The source for the examples will be in the \examples{} section of the 
.Rd source file -- that didn't change.  What changed was how the source 
is processed.  The files are now parsed into a binary format that is 
stored in the database files.


You can extract the examples from the source file using the tools::Rd2ex 
function.  You can extract them from the binary database using this 
function on an Rd object, which is obtainable using the internal 
function .getHelpFile.


So for example, to see the code for the example for rwishart, you could do

tools::Rd2ex(.../bayesm/man/rwishart.Rd)

if you have the source file installed there, or

library(bayesm)
Rd - utils:::.getHelpFile(?rwishart)
tools::Rd2ex(Rd)

if you have the package installed.

Duncan Murdoch


In particular I'm looking for the latest example scripts in the baysem
package. I don't see them in the source code or the installed library.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Read.table mucks up headers

2014-04-19 Thread starter
Hello Milan

It had worked perfectly before, but now I am trying on a different text file
but using the trick you showed I just get the headers in the output and that
too as row.names and X.

*code:*
corr - read.table(E:/temp/corrosion
data.txt,header=T,fileEncoding=UTF-8-BOM)

 dput(corr)
structure(list(ï...Weight. = c(13.74, 12.97, 10.78, 10.53, 10.16, 
9.38, 9.23, 9.2, 17.24, 18, 15.12, 16.08, 13.71, 13.81, 12.61, 
14.03), Piece = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L), Time = c(96L, 84L, 72L, 60L, 48L, 36L, 24L, 
12L, 96L, 96L, 72L, 60L, 48L, 36L, 24L, 12L)), .Names = c(ï...Weight., 
Piece, Time), class = data.frame, row.names = c(NA, -16L
))

 str(corr)
'data.frame':   16 obs. of  3 variables:
 $ ï...Weight.: num  13.7 13 10.8 10.5 10.2 ...
 $ Piece  : int  1 1 1 1 1 1 1 1 2 2 ...
 $ Time   : int  96 84 72 60 48 36 24 12 96 96 ...

Please tell me what I am doing wrong.



--
View this message in context: 
http://r.789695.n4.nabble.com/Read-table-mucks-up-headers-tp4688742p4689099.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Read.table mucks up headers

2014-04-19 Thread Uwe Ligges



On 19.04.2014 14:30, starter wrote:

Hello Milan

It had worked perfectly before, but now I am trying on a different text file
but using the trick you showed I just get the headers in the output and that
too as row.names and X.

*code:*
corr - read.table(E:/temp/corrosion
data.txt,header=T,fileEncoding=UTF-8-BOM)



Which R version?
Are you sure this is UTF-8-BOM and not UCS-2LE or UTF-16LE?

Best,
Uwe Ligges



dput(corr)

structure(list(ï...Weight. = c(13.74, 12.97, 10.78, 10.53, 10.16,
9.38, 9.23, 9.2, 17.24, 18, 15.12, 16.08, 13.71, 13.81, 12.61,
14.03), Piece = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L), Time = c(96L, 84L, 72L, 60L, 48L, 36L, 24L,
12L, 96L, 96L, 72L, 60L, 48L, 36L, 24L, 12L)), .Names = c(ï...Weight.,
Piece, Time), class = data.frame, row.names = c(NA, -16L
))


str(corr)

'data.frame':   16 obs. of  3 variables:
  $ ï...Weight.: num  13.7 13 10.8 10.5 10.2 ...
  $ Piece  : int  1 1 1 1 1 1 1 1 2 2 ...
  $ Time   : int  96 84 72 60 48 36 24 12 96 96 ...

Please tell me what I am doing wrong.



--
View this message in context: 
http://r.789695.n4.nabble.com/Read-table-mucks-up-headers-tp4688742p4689099.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] problem with pip2d() from ptinpoly

2014-04-19 Thread Waichler, Scott R
Thank you for catching that, Boris.  I'm surprised, given that there is no 
mention of sense of direction in the package documentation.

Scott Waichler

 -Original Message-
 From: Boris Steipe [mailto:boris.ste...@utoronto.ca]
 Sent: Friday, April 18, 2014 3:49 PM
 To: Waichler, Scott R; r-help@r-project.org
 Subject: Re: [R] problem with pip2d() from ptinpoly
 
 Apparently it matters whether your polygon is defined clockwise or
 counterclockwise.
 
 A point outside your triangle is recognized ...
  q2 - matrix(c(594893.0,115435.0), ncol=2, byrow=T) pip2d(Vertices =
  verts, Queries = q2)
 [1] 1
 
 ... and defining the triangle in counterclockwise sense gives the expected
 behaviour.
  v2 - matrix(c(594891,115309,594891,117201,59,117201), ncol=2,
  byrow=T) pip2d(Vertices = v2, Queries = query)
 [1] 1
 
 Cheers,
 B.

 On 2014-04-18, at 6:00 PM, Waichler, Scott R wrote:
 
  Hi,
 
  pip2d() doesn't seem to work correctly for me.  I have a plot of a
 triangle that a query point fits inside, but the point is defined as
 outside the polygon by pip2d.
 
  library(ptinpoly)
  verts - matrix(c(594891,115309,59,117201,594891,117201), ncol=2,
  byrow=T) query - matrix(c(594885.0,115435.0), ncol=2, byrow=T)
  pip2d(Vertices = verts, Queries = query)  # result = -1 # contrary to
  -1 output of pip2d, plot shows point lies within triangle
  plot(c(594400, 595000), c(115000, 117500), type=n) polygon(verts,
  border=red) points(x=query[,1], y=query[,2], col=blue)
 
  Scott Waichler
  Pacific Northwest National Laboratory
  Richland, WA, USA

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] XML getNodeSet

2014-04-19 Thread Timothy W. Cook
SOLVED: (mostly)

So I'll post this here in case it helps someone in the future.

fileName - '001.xml'

doc - xmlTreeParse(fileName,
handlers=list(comment=function(x,...){NULL}), asTree = TRUE)
root - xmlRoot(doc)

Connected_To - xmlToDataFrame(getNodeSet(root,
'//ccd:el-e3657392-8e26-42a4-a996-258f9e645c46',ccd))

Must use xmlTreeParse.

Connected_To is a dataframe with the element names as colnames and the rows
are for each instance in the file.

I still get an warning:

Namespace prefix ccd on el-e3657392-8e26-42a4-a996-258f9e645c46 is not defined


I haven't quite found the solution for this namespace problem. I have tried
a few functions/examples from the XML package but they usually return a
list instead of a character vector.  But the result dataframe from the XML
is correct and that is my initial goal.

Cheers,
Tim



On Thu, Apr 17, 2014 at 3:54 PM, Timothy W. Cook t...@mlhim.org wrote:

 Apologies, I forgot to add details:
 platform   x86_64-pc-linux-gnu
 arch   x86_64
 os linux-gnu
 system x86_64, linux-gnu
 status
 major  3
 minor  0.1
 year   2013
 month  05
 day16
 svn rev62743
 language   R
 version.string R version 3.0.1 (2013-05-16)
 nickname   Good Sport

 Executed inside R Studio Version 0.98.501



 On Thu, Apr 17, 2014 at 12:35 PM, Timothy W. Cook t...@mlhim.org wrote:

 R newbie, experienced software developer.

 I have a bit of confusion regarding using this function. See the XML
 fragment at the end of the post.

 This works as far as retrieving the nodeset:

  fileName - '/home/tim/MLHIM/git/EpiS3/test_ccd/inst/examples/001.xml'

  doc - xmlInternalTreeParse(fileName) nodes - 
  getNodeSet(doc,'//ccd:el-e3657392-8e26-42a4-a996-258f9e645c46') 
  Connected_To=xmlToDataFrame(nodes)


 The result is:

  str(Connected_To)'data.frame': 1 obs. of  7 variables:
  $ comment : Factor w/ 1 level  DvURI : 1
  $ data-name   : Factor w/ 1 level Connected To: 1
  $ valid-time-begin: Factor w/ 1 level  Use any subtype of ExceptionalValue 
 here when a value is missing: 1
  $ valid-time-end  : Factor w/ 1 level 2020-06-07T01:31:49Z: 1
  $ DvURI-dv: Factor w/ 1 level 2009-01-20T08:40:53Z: 1
  $ relation: Factor w/ 1 level http://www.ccdgen.com: 1
  $ NA  : Factor w/ 1 level connected to: 1


 The line:

 $ valid-time-begin: Factor w/ 1 level  Use any subtype of ExceptionalValue 
 here when a value is missing: 1

  has a value that is a comment that occurs before the element. Then each
 value is shifted by one place with an extra one at the end.

 My desired solution would be to remove commenteds from the parsed tree.
  So I did this:

  doc - xmlInternalTreeParse(fileName, 
  handlers=list(comment=function(x,...){NULL}), useInternalNodes = TRUE)

 But now when I attempt to get the nodes I get an error.

  nodes - 
  getNodeSet(doc,'//ccd:el-e3657392-8e26-42a4-a996-258f9e645c46')Error in 
  UseMethod(xpathApply) :
   no applicable method for 'xpathApply' applied to an object of class list


 I am not sure what the error is telling me nor how to fix it.


 All suggestions are welcome and appreciated.   Maybe I should be using a
 different approach to solving the issue with extracting the data.frame?

 Regads,
 Tim




 XML fragment:
 ccd:el-e3657392-8e26-42a4-a996-258f9e645c46
   !-- DvURI --
   data-nameConnected To/data-name
   !-- Use any subtype of ExceptionalValue here when a value is
 missing--
   valid-time-begin2020-06-07T01:31:49Z/valid-time-begin
   valid-time-end2009-01-20T08:40:53Z/valid-time-end
   DvURI-dvhttp://www.ccdgen.com/DvURI-dv
   relationconnected to/relation
 /ccd:el-e3657392-8e26-42a4-a996-258f9e645c46

 --
 MLHIM VIP Signup: http://goo.gl/22B0U
 
 Timothy Cook, MSc   +55 21 994711995
 MLHIM http://www.mlhim.org
 Like Us on FB: https://www.facebook.com/mlhim2
 Circle us on G+: http://goo.gl/44EV5
 Google Scholar: http://goo.gl/MMZ1o
 LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook




 --
 MLHIM VIP Signup: http://goo.gl/22B0U
 
 Timothy Cook, MSc   +55 21 994711995
 MLHIM http://www.mlhim.org
 Like Us on FB: https://www.facebook.com/mlhim2
 Circle us on G+: http://goo.gl/44EV5
 Google Scholar: http://goo.gl/MMZ1o
 LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook




-- 


Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.org

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Foreign function interface

2014-04-19 Thread Alex van der Spek

I read the Foreign Function Interface for R.

The documentation does not prescribe the calling convention though.

Does that mean __stdcall on W32 and __cdecl for Linux?

Regards,
Alex van der Spek

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] cbind with row names to serveral files in R

2014-04-19 Thread arun
Hi,
The rownames part is not clear as your expected output and input files didn't 
show them as rownames. 


##Suppose you have all the files in a folder
##here I am creating the names of those files

files1 - paste0(sample, rep(1:777, each=29),chr,1:29,.txt)
length(files1)
#[1] 22533
lst1 -  split(files1,as.numeric(gsub(.*chr(\\d+)\\..*,\\1,files1)))

##use list.files() 

##in your case, ##not tested

lst1 - split(list.files(pattern=sample\\d+), 
as.numeric(gsub(.*chr(\\d+)\\..*,\\1,list.files(pattern=sample\\d+ 
##in case other files are also in the folder

library(plyr)

lst2 - lapply(lst1,function(x) {x1 -join_all(lapply(x,function(y) 
read.table(y,header=TRUE,stringsAsFactors=FALSE,sep=)),c(Name,Chr,Position))
 })


lapply(seq_along(lst2),function(i) 
write.table(lst2[[i]],paste0(LRRrawallchr,i,.txt),row.names=FALSE,quote=FALSE))


###if you need to create rownames using the first three columns:
lapply(seq_along(lst2),function(i) {x1 - lst2[[i]]; row.names(x1) - 
as.character(interaction(x1[,1:3],sep=_)); x2 - x1[,-(1:3)]; write.table(x2, 
paste0(LRRrawallchr,i,.txt), quote=FALSE)})



A.K.


I would like to use the `cbind` in a list of files. However each file are 
splited in a specific chromosome (chr) `(k in 1:29)`, and specific sample `(i 
in 1:777)`. The files are like:


sample1chr1.txt, sample1chr2.txt ... sample1chr29.txt, sample2chr1.txt ... 
sample777chr29.txt

All files have exactly the same rows names (3 first collumns represent my row 
names). I would like to get a final file to each chr merging to all sample 
files, with and do not repeat the row names in the final file (the first 3 
collumns representing my rows names).

I tried this:

`#Creating file with row names (3 first collumns) to each Chr
{
{for(k in 1:29){
  infile - paste0(sample1chr,k,.txt)
  outfile - paste0(LRRrawallchr,k,.txt)
  rows - read.table(infile, header=TRUE, sep=\t)
  rows - rows[, -grep(Log.R.Ratio, colnames(rows))]
  write.table(rows, outfile, sep=;)}}`

`#Cbind in one file per Chr
{  for(i in 1:777)
  for(k in 1:29){
    base - paste0(LRRrawallchr,k,.txt)
    chr - read.table(base, header=TRUE, sep=;)
    infile - paste0(sample,i,chr,k,.txt)
    chr2 - read.table(infile, header=TRUE, sep=\t)
    outfile - paste0(LRRrawallchr,k,.txt)
    chr2 - chr2[, -grep(Name, colnames(chr2))]
    chr2 - chr2[, -grep(Chr, colnames(chr2))]
    chr2 - chr2[, -grep(Position, colnames(chr2))]
    chr - cbind(chr, chr2)
    write.table(chr, outfile, sep=;, row.names=FALSE, col.names=FALSE)}
}`

Input example (sample1chr1.txt):

   

 Name   Chr Position sample1value
    BAC-11034 1 128   0.302
    BAC-11044 1 129   -0.56
    BAC-11057 1 134   0.0840

Input example (sample2chr1.txt):

    Name   Chr Position  sample2value
    BAC-11034 1 128   0.25
    BAC-11044 1 129   0.41
    BAC-11057 1 134  -0.14

Expected output (LRRrawallchr1):

    Name   Chr Position    sample1value   sample2value
    BAC-11034 1 128    0.302  0.25
    BAC-11044 1 129    -0.56  0.41
    BAC-11057 1 134    0.0840 -0.14

I have 22553 diferent .txt files (29 files (one per chr) to each of 777 
samples). All 22553 files (sample1chr1.txt, sample1chr2.txt ... 
sample1chr29.txt, sample2chr1.txt ... sample777chr29.txt) are like above 
example.  

I wanna 29 files like (LRRrawallchr1), one per Chr. The LRRrawallchr,k, files 
have to be with 777+3 (800 collumns). The 3 row names and one collumn per 
sample.

Cheers! 


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] cex values being ignored in the curve function

2014-04-19 Thread Philip Robinson

Dear R-Community,

The cex values in curve seem to be being ignored. I have searched 
previous help questions and also the web generally, and cannot find this 
being a major problem so I am suspicious of something odd happening but 
I am at a loss to work out why.


I am trying to plot this:

b1  - -0.858
pow- 0.8
ratio   - 1
sig  - 0.05

curve((qnorm(1-sig/2)+qnorm(pow))^2/b1^2/x/(ratio/(1+ratio))/(1/(1+ratio)),from=0.005,to=0.08,main=This 
needs to be bigger,xlab=And this bigger too,ylab=And this too, 
cex=1,cex.lab=3.5, cex.axis=3.5, cex.main=3.5, cex.sub=3.5)


But no matter what value of cex I make it, or whether I break up the 
arguments into :


title(main=something,cex.main=3)
axis(cex.axis=2)

or parse this before plotting : par(cex.lab=1.5, cex.axis=1.5, 
cex.main=3.5, cex.sub=1.5)


I cannot get the main, axis titles or axis numbers to change in size, 
whatever I do.


I am using a macbook pro, with mavericks, R-studio and R 3.1.0 
spring-dance, and I am initiating the plot with:


X11( width=width , height=height , type=cairo).

Any help would be greatly appreciated.

thanks
Philip

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Difference between times

2014-04-19 Thread Nicola Sturaro Sommacal
Thank you for your reply.

I discovered the OlsonNames() function to get the time-zone names in my
system. Rui get a warning message when using a not recognized tz. On my
system this doesn't succed.

I solved as follow:

dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
Europe/Rome)

dt2 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
America/Los_Angeles)

dt1[1] 2014-04-18 09:00:00 CESTdt2[1] 2014-04-18 09:00:00
PDTdt1-dt2Time difference of -9 hours


Thank you,
Nicola



2014-04-18 21:59 GMT+02:00 Prof Brian Ripley rip...@stats.ox.ac.uk:

 On 18/04/2014 19:46, Rui Barradas wrote:

 Hello,

 The reason why is that you've misspelled CET (not CEST)


 Neither CET nor CEST are portable time-zone names.  We have not been given
 the 'at a minimum' information required by the posting guide, so please
 read ?Sys.timezone on your system.




   dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 CEST)
 Warning messages:
 1: In strptime(x, format, tz = tz) : unknown timezone 'CEST'
 2: In as.POSIXct.POSIXlt(as.POSIXlt(x, tz, ...), tz, ...) :
unknown timezone 'CEST'
   dt2 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 GMT)
   dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 CET)
   dt1-dt2
 Time difference of -2 hours


 Hope this helps,

 Rui Barradas

 Em 18-04-2014 17:13, Nicola Sturaro Sommacal escreveu:

 Hi.

 I am new to POSIX and I'd like to understand the reason of this
 difference.

 dt1 = as.POSIXct(2014-03-29 09.00, format=%Y-%m-%d %H.%M)
 dt2 = as.POSIXct(2014-03-30 09.00, format=%Y-%m-%d %H.%M)
 dt2-dt1

  dt1[1] 2014-03-29 09:00:00 CET dt2[1] 2014-03-30 09:00:00 CEST
 dt2-dt1


 Time difference of 23 hours

 This is right, because on Mar 31 at 2 PM we jump directly to 3PM, DST.

 On the contrary, I don't understand the following:

 dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 CEST)
 dt2 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 GMT)

  dt1[1] 2014-04-18 09:00:00 CEST dt2[1] 2014-04-18 09:00:00 GMT
 dt1-dt2Time difference of 0 secs



 I should expected a time difference of 2 hours, as CEST is GMT+2.

 Anyone can help me?

 Thank you,
 Nicola

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



 --
 Brian D. Ripley,  rip...@stats.ox.ac.uk
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Need help to convert data frame to transaction set.

2014-04-19 Thread Sathish Kumar
Hi,

To convert coerce the data set to transaction data set I used the code

trans4 - as(split(a[,Cust_ID], a[,Parts]), transactions)

but I am getting the following error-

Error in as(split(a[, Cust_ID], a[, Parts]), transactions) : nomethod
or default for coercing “list” to “transactions”



Then I tried first converting the data set to matrix structure using the
code

c_m-as.matrix(c_df)
 c_m



then entered the following code


trans2 - as(c_m, transactions)

but got the following error

Error in as(c_m, transactions) : no method or default for coercing
“matrix” to “transactions”
Please let me know how to correct the problem.

Thanks
Sathish
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R Statistical Computing Language Preference Help

2014-04-19 Thread burak ömer saraçoglu


Dear R Developers and Help Specialists; 
I downloaded and installed R to learn and use it during solutions of my 
scientific studies.
At first, I got in trouble with it with the menu languages. It is in Turkish 
and I have to change it to English but I can not find where the language 
preferences menu or options menu is.
Could you please let me know how I can select the English Language as the main 
language of the software (for menus, help etc.)
Your kindness and help will be very much appriciated.
Please do not publish on web my e-mail. 
Have a nice day.
Best Regards
Dr. Burak Omer Saracoglu
PhD in Graduate School of Science Engineering and Technology
MSc in Industrial Engineering
BSc in Naval Architecture and Marine Engineering



  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to use rainbow function without the gamma argument

2014-04-19 Thread Francesco Brundu
Hi all,
I am using an old code (probably written for R 2.5) and it stops when
calling rainbow() with gamma argument. I saw that gamma argument is not
present in newer version of R rainbow function. How can I translate this
line of code:

rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75, gamma = 1.5)

?

It fails with:

Error in rainbow(100, s = 1, v = 0.75, start = 0, end = 0.75, gamma = 1.5)
:
  unused argument (gamma = 1.5)
Calls: nmfconsensus ... matrix.abs.plot - image - image.default - rainbow
Execution halted

Thanks

~ Francesco Brundu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Difference between times

2014-04-19 Thread Nicola Sturaro Sommacal
I forgot:

  sysname
 release
  Linux
  3.5.0-48-generic
  version
#72-Ubuntu SMP Mon Mar 10 23:18:29 UTC 2014



2014-04-19 14:03 GMT+02:00 Nicola Sturaro Sommacal 
mailingl...@nicolasturaro.com:

 Thank you for your reply.

 I discovered the OlsonNames() function to get the time-zone names in my
 system. Rui get a warning message when using a not recognized tz. On my
 system this doesn't succed.

 I solved as follow:

 dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz = 
 Europe/Rome)

 dt2 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz = 
 America/Los_Angeles)

 dt1[1] 2014-04-18 09:00:00 CESTdt2
 [1] 2014-04-18 09:00:00 PDTdt1-dt2Time difference of -9 hours


 Thank you,
 Nicola



 2014-04-18 21:59 GMT+02:00 Prof Brian Ripley rip...@stats.ox.ac.uk:

 On 18/04/2014 19:46, Rui Barradas wrote:

 Hello,

 The reason why is that you've misspelled CET (not CEST)


 Neither CET nor CEST are portable time-zone names.  We have not been
 given the 'at a minimum' information required by the posting guide, so
 please read ?Sys.timezone on your system.




   dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 CEST)
 Warning messages:
 1: In strptime(x, format, tz = tz) : unknown timezone 'CEST'
 2: In as.POSIXct.POSIXlt(as.POSIXlt(x, tz, ...), tz, ...) :
unknown timezone 'CEST'
   dt2 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 GMT)
   dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 CET)
   dt1-dt2
 Time difference of -2 hours


 Hope this helps,

 Rui Barradas

 Em 18-04-2014 17:13, Nicola Sturaro Sommacal escreveu:

 Hi.

 I am new to POSIX and I'd like to understand the reason of this
 difference.

 dt1 = as.POSIXct(2014-03-29 09.00, format=%Y-%m-%d %H.%M)
 dt2 = as.POSIXct(2014-03-30 09.00, format=%Y-%m-%d %H.%M)
 dt2-dt1

  dt1[1] 2014-03-29 09:00:00 CET dt2[1] 2014-03-30 09:00:00 CEST
 dt2-dt1


 Time difference of 23 hours

 This is right, because on Mar 31 at 2 PM we jump directly to 3PM, DST.

 On the contrary, I don't understand the following:

 dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 CEST)
 dt2 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz =
 GMT)

  dt1[1] 2014-04-18 09:00:00 CEST dt2[1] 2014-04-18 09:00:00 GMT
 dt1-dt2Time difference of 0 secs



 I should expected a time difference of 2 hours, as CEST is GMT+2.

 Anyone can help me?

 Thank you,
 Nicola

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



 --
 Brian D. Ripley,  rip...@stats.ox.ac.uk
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Extracting the names of coefficients of random effects

2014-04-19 Thread Brian Willis
Hi All,
I need to be able to manipulate the names of the coefficients from
*ranef()*.

If there is any missing data when fitting a mixed model using lmer, no
estimate is returned for the associated level for that random effect. Thus
if the data input for regions had levels 
*Region*
Bolton
Bradford
  
Cambridge   
 
Durham   
and there was missing data on Bradford then 
* ranef(model)* gives 
 (Intercept)
Bolton:   -0.0981763413
Cambridge  0.0151102347
Durham 0.1837142259

This becomes a problem if I want to use *predict( )* on new data where there
is no missing data on Bradford. In such an instance

*predict (model, newdata = newInput) *  gives the following error 
message 

 ‘Error in (function (x, n)  : new levels detected in newdata’

I could get round this by checking the Region field of the new data
‘newInput’ against the names of the levels of the intercept coefficients
from* ranef().*
However, I’m not sure how to access these since if 
*x- ranef(model)
x *
This gives the same output above, but

*x[1,1]* only returns the numeric value  -0.0981763413

x is a dataframe with only one field (column) with numeric values and the
names of the levels are not present or identified. There must be a variable
which defines ‘Bolton’, Bradford’ etc since if I use the write.table
function
*write.table (x, file=/desktop/Dummy.csv, sep = ,,  col.names = NA, 
qmethod = double)*
This outputs both the names (‘Bolton’, Bradford’..) and their corresponding
numeric values to a spreadsheet.

Does anyone know how to do this without resorting to outputting to a
spreadsheet?
 
Regards,

Brian H Willis
Health and Population Sciences
University of Birmingham




--
View this message in context: 
http://r.789695.n4.nabble.com/Extracting-the-names-of-coefficients-of-random-effects-tp4689109.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] cex values being ignored in the curve function

2014-04-19 Thread Bert Gunter
Don't know if this helps, but works for me on a PC under Windows 7
with the default graphics device. Try a different device, maybe (e.g.
pdf) ??

-- Bert



Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374(650) 467-7374

Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom.
H. Gilbert Welch


Call
Send SMS
Add to Skype
You'll need Skype CreditFree via Skype

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R Statistical Computing Language Preference Help

2014-04-19 Thread Bert Gunter
Search!

Googling on How to set language for R produced this:

https://stat.ethz.ch/pipermail/r-help/2008-October/178503.html

If this is not what you need, a little more searching may be required.

Cheers,
Bert



Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom.
H. Gilbert Welch




On Sat, Apr 19, 2014 at 2:10 AM, burak ömer saraçoglu
burakomersaraco...@hotmail.com wrote:


 Dear R Developers and Help Specialists;
 I downloaded and installed R to learn and use it during solutions of my 
 scientific studies.
 At first, I got in trouble with it with the menu languages. It is in Turkish 
 and I have to change it to English but I can not find where the language 
 preferences menu or options menu is.
 Could you please let me know how I can select the English Language as the 
 main language of the software (for menus, help etc.)
 Your kindness and help will be very much appriciated.
 Please do not publish on web my e-mail.
 Have a nice day.
 Best Regards
 Dr. Burak Omer Saracoglu
 PhD in Graduate School of Science Engineering and Technology
 MSc in Industrial Engineering
 BSc in Naval Architecture and Marine Engineering




 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to use rainbow function without the gamma argument

2014-04-19 Thread Boris Steipe
Have you looked at ?rainbow ?
Is there a reason why you don't simply leave the gamma parameter away?

Try:
pie(rep(1,100), col=rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75))

Cheers,
B.


On 2014-04-19, at 6:05 AM, Francesco Brundu wrote:

 Hi all,
 I am using an old code (probably written for R 2.5) and it stops when
 calling rainbow() with gamma argument. I saw that gamma argument is not
 present in newer version of R rainbow function. How can I translate this
 line of code:
 
 rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75, gamma = 1.5)
 
 ?
 
 It fails with:
 
 Error in rainbow(100, s = 1, v = 0.75, start = 0, end = 0.75, gamma = 1.5)
 :
  unused argument (gamma = 1.5)
 Calls: nmfconsensus ... matrix.abs.plot - image - image.default - rainbow
 Execution halted
 
 Thanks
 
 ~ Francesco Brundu
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] inverse normal distribution function

2014-04-19 Thread Suzen, Mehmet
You may want to read about generalized linear modelling and link
functions for forming appropriate categorical variable/link function.
See documentations in R:  ?glm, ?family and ?inverse.gaussian.  Also
look at the original paper of Nelder, John; Wedderburn, Robert , it is
available freely with the courtesy of JSTOR:
http://www.jstor.org/discover/10.2307/2344614

On 18 April 2014 09:13, thanoon younis thanoon.youni...@gmail.com wrote:
 dear all members

 i want to use inverse normal distribution in R to show the value of
 variable Z when Z represent the ordered categorical variables. i hope
 anyone gives me an example on this distribution
 .

 thanks to all

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] inverse normal distribution function

2014-04-19 Thread Suzen, Mehmet
Not sure how would you do that but there is a package SEM on CRAN for
structural equation models.

On 20 April 2014 01:10, thanoon younis thanoon.youni...@gmail.com wrote:
 thank you so much Suzen
 i want to use bayesian analysis in structural equation models with ordered
 categorical data and i want to use inverse normal as a distribution of
 thresholds and i  dont find any paper or documents in R or another program
 about inverse normal.

 best regards


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to use rainbow function without the gamma argument

2014-04-19 Thread Boris Steipe
If it MUST be parameter-compatible with the old call, you could just add ... 
to your local version of rainbow. The unused parameter will then be dropped. 

Here's how:

# The original creates an error ...
rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75, gamma = 1.5)

Error in rainbow(100, s = 1, v = 0.75, start = 0, end = 0.75, gamma = 1.5) : 
  unused argument (gamma = 1.5)

# The code of the function is here:
 rainbow
function (n, s = 1, v = 1, start = 0, end = max(1, n - 1)/n, 
alpha = 1) 
{
if ((n - as.integer(n[1L]))  0) {
if (start == end || any(c(start, end)  0) || any(c(start, 
end)  1)) 
stop('start' and 'end' must be distinct and in [0, 1].)
hsv(h = seq.int(start, ifelse(start  end, 1, 0) + end, 
length.out = n)%%1, s, v, alpha)
}
else character()
}
bytecode: 0x101968950
environment: namespace:grDevices

# I add ... to the parameters and define a local version of rainbow

rainbow = function (n, s = 1, v = 1, start = 0, end = max(1, n - 1)/n, 
 alpha = 1, ...) 
 {
 if ((n - as.integer(n[1L]))  0) {
 if (start == end || any(c(start, end)  0) || any(c(start, 
 end)  1)) 
 stop('start' and 'end' must be distinct and in [0, 1].)
 hsv(h = seq.int(start, ifelse(start  end, 1, 0) + end, 
 length.out = n)%%1, s, v, alpha)
 }
 else character()
 }

# same code except for the dots...
# Now it accepts and discards unused arguments
 rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75, gamma = 1.5, 
 gefingerpoken = TRUE)
  [1] #BFFF #BF0900FF #BF1100FF #BF1A00FF #BF2300FF #BF2B00FF 
#BF3400FF
[...]
 [99] #5700BFFF #6000BFFF

# and if I want the original back, I just delete my local version ...
 rm(rainbow)
 rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75, gamma = 1.5)
Error in rainbow(100, s = 1, v = 0.75, start = 0, end = 0.75, gamma = 1.5) : 
  unused argument (gamma = 1.5)

 rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75)
  [1] #BFFF #BF0900FF #BF1100FF #BF1A00FF #BF2300FF #BF2B00FF 
#BF3400FF
[...]
 [99] #5700BFFF #6000BFFF

You can read about the '...' argument in the Introduction to R. Here we use it 
not to pass variables on, but to have them not cause an error when present.

HOWEVER: I personally would consider this poor style. It's probably better to 
review and update your old code. There may be other less obvious problems.

YMMV
B.





On 2014-04-19, at 7:19 PM, Francesco Brundu wrote:

 Hi Boris,
 yes I tried this way and it worked. The fact is that I wanted to be compliant 
 with the old code, I did not want to change anything. So I wanted to find a 
 new way to rewrite the code.
 Thanks
 
 ~ Francesco Brundu
 
 
 On 19 April 2014 23:18, Boris Steipe boris.ste...@utoronto.ca wrote:
 Have you looked at ?rainbow ?
 Is there a reason why you don't simply leave the gamma parameter away?
 
 Try:
 pie(rep(1,100), col=rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75))
 
 Cheers,
 B.
 
 
 On 2014-04-19, at 6:05 AM, Francesco Brundu wrote:
 
  Hi all,
  I am using an old code (probably written for R 2.5) and it stops when
  calling rainbow() with gamma argument. I saw that gamma argument is not
  present in newer version of R rainbow function. How can I translate this
  line of code:
 
  rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75, gamma = 1.5)
 
  ?
 
  It fails with:
 
  Error in rainbow(100, s = 1, v = 0.75, start = 0, end = 0.75, gamma = 1.5)
  :
   unused argument (gamma = 1.5)
  Calls: nmfconsensus ... matrix.abs.plot - image - image.default - rainbow
  Execution halted
 
  Thanks
 
  ~ Francesco Brundu
 
[[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Need help to convert data frame to transaction set.

2014-04-19 Thread arun


Hi,

Without a reproducible example using ?dput() or the package name, it is a bit 
difficult to comment.

Assuming that you used:
library(arules)
 data(AdultUCI)
AdultUCI$ID - 1:nrow(AdultUCI)

lst1 - split(AdultUCI[,ID], AdultUCI[,marital-status])
 as(lst1, transactions)
#transactions in sparse format with
# 7 transactions (rows) and
# 48842 items (columns)



A.K.


On Saturday, April 19, 2014 5:01 PM, Sathish Kumar tellsath...@gmail.com 
wrote:
Hi,

To convert coerce the data set to transaction data set I used the code

trans4 - as(split(a[,Cust_ID], a[,Parts]), transactions)

but I am getting the following error-

Error in as(split(a[, Cust_ID], a[, Parts]), transactions) : nomethod
or default for coercing “list” to “transactions”



Then I tried first converting the data set to matrix structure using the
code

c_m-as.matrix(c_df)
c_m



then entered the following code


trans2 - as(c_m, transactions)

but got the following error

Error in as(c_m, transactions) : no method or default for coercing
“matrix” to “transactions”
Please let me know how to correct the problem.

Thanks
Sathish
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Need help to convert data frame to transaction set.

2014-04-19 Thread arun


Hi Satish,

Using your code:
part-read.csv(spares.csv)
str(part)
#'data.frame':    838 obs. of  1 variable:
# $ Cust_ID.Parts: Factor w/ 838 levels 100\tAIR\tFILTER\tHOUSING\t,..: 161 
333 495 727 728 768 769 770 784 785 ...

#I guess you have only two columns in the dataset

 lines1 - readLines(spares.csv)
 head(lines1)
#[1] Cust_ID\tParts\t\t\t  1\tFENDERS\t\t\t 
#[3] 2\tFENDERS\t\t\t  3\tOIL\tFILTERS\t\t  
#[5] 4\tBMW\tSERVICE\tFLUIDS\t 4\tOIL\tFILTER\t\t   


part-read.csv(spares.csv,header=TRUE,sep=\t)
 str(part)
#'data.frame':    838 obs. of  5 variables:
# $ Cust_ID: int  1 2 3 4 4 5 5 5 6 6 ...
# $ Parts  : Factor w/ 26 levels AIR,ALTERNATOR,..: 9 9 16 4 16 6 9 12 6 9 
...
# $ X  : Factor w/ 14 levels ,BLADES,CAR,..: 1 1 6 14 5 1 1 1 1 1 ...
# $ X.1    : Factor w/ 6 levels ,(AXLE,CARE,..: 1 1 1 4 1 1 1 1 1 1 ...
# $ X.2    : Factor w/ 2 levels ,BOOT): 1 1 1 1 1 1 1 1 1 1 ...


part$Parts - interaction(part[,2:5],sep= ,drop=TRUE)
 part - part[,1:2]
 str(part)
#'data.frame':    838 obs. of  2 variables:
# $ Cust_ID: int  1 2 3 4 4 5 5 5 6 6 ...
# $ Parts  : Factor w/ 31 levels ALTERNATOR   ,..: 6 6 21 28 20 3 6 8 3 6 ...
as(split(part[,Cust_ID],part[,Parts]),transactions)
#transactions in sparse format with
# 31 transactions (rows) and
# 502 items (columns)
A.K.



On Saturday, April 19, 2014 11:08 PM, Sathish Kumar tellsath...@gmail.com 
wrote:

Hi AK,

I have attached  the data set. 

And as you suggested, I coded as follows but still I am getting an error 

 part-read.csv(spares.csv)
 part
lst1-split(part[,Cust_ID],part[,Parts])
 as(lst1, transactions)

Error in as(lst1, transactions) : 
  no method or default for coercing “list” to “transactions”



On Sat, Apr 19, 2014 at 6:43 PM, arun smartpink...@yahoo.com wrote:



Hi,

Without a reproducible example using ?dput() or the package name, it is a bit 
difficult to comment.

Assuming that you used:
library(arules)
 data(AdultUCI)
AdultUCI$ID - 1:nrow(AdultUCI)

lst1 - split(AdultUCI[,ID], AdultUCI[,marital-status])
 as(lst1, transactions)
#transactions in sparse format with
# 7 transactions (rows) and
# 48842 items (columns)



A.K.



On Saturday, April 19, 2014 5:01 PM, Sathish Kumar tellsath...@gmail.com 
wrote:
Hi,

To convert coerce the data set to transaction data set I used the code

trans4 - as(split(a[,Cust_ID], a[,Parts]), transactions)

but I am getting the following error-

Error in as(split(a[, Cust_ID], a[, Parts]), transactions) : nomethod
or default for coercing “list” to “transactions”



Then I tried first converting the data set to matrix structure using the
code

c_m-as.matrix(c_df)
c_m



then entered the following code


trans2 - as(c_m, transactions)

but got the following error

Error in as(c_m, transactions) : no method or default for coercing
“matrix” to “transactions”
Please let me know how to correct the problem.

Thanks
Sathish
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.