Re: [R] Aggregate data to lower resolution

2017-01-19 Thread Adams, Jean
Milu,

To get the quickest help and keep everyone in the loop, you should cc the
help list.

I don't understand your question.  If you want the mean GDP use the mean
function, if you want the sum of the GDP use the sum function.

Jean

On Fri, Jan 13, 2017 at 5:33 PM, Miluji Sb  wrote:

> Dear Jean,
>
> Greetings of the new year. Hope you are doing well.
>
> I apologise for writing to you off-list but this might be a really silly
> question and I wanted to clarify without bothering everyone. Would kindly
> help me out? Hope this is not too much of a bother.
>
> My original question was regarding aggregating data to 1 degree x 1
> degree. You had kindly provided the following solution:
>
> temp$long1 <- floor(temp$longitude)
> temp$lat1 <- floor(temp$latitude)
> temp1 <- aggregate(GDP ~ long1 + lat1, temp, mean)
>
> Everything works well, my only question (and confusion) is that for
> aggregating from 0.5 degree by 0.5 degree to 1 degree by 1 degree, should
> we use sum instead of mean?
>
> temp1 <- aggregate(GDP ~ long1 + lat1, temp, sum)
>
> I really hope I'm not bothering you too much. Thanks again.
>
> Sincerely,
>
> Milu
>
> On Fri, Jul 22, 2016 at 3:06 PM, Adams, Jean  wrote:
>
>> Milu,
>>
>> Perhaps an approach like this would work.  In the example below, I
>> calculate the mean GDP for each 1 degree by 1 degree.
>>
>> temp$long1 <- floor(temp$longitude)
>> temp$lat1 <- floor(temp$latitude)
>> temp1 <- aggregate(GDP ~ long1 + lat1, temp, mean)
>>
>>   long1 lat1GDP
>> 1   -69  -55 0.90268640
>> 2   -68  -55 0.09831317
>> 3   -72  -54 0.22379000
>> 4   -71  -54 0.14067290
>> 5   -70  -54 0.00300380
>> 6   -69  -54 0.00574220
>>
>> Jean
>>
>> On Thu, Jul 21, 2016 at 3:57 PM, Miluji Sb  wrote:
>>
>>> Dear all,
>>>
>>> I have the following GDP data by latitude and longitude at 0.5 degree by
>>> 0.5 degree.
>>>
>>> temp <- dput(head(ptsDF,10))
>>> structure(list(longitude = c(-68.25, -67.75, -67.25, -68.25,
>>> -67.75, -67.25, -71.25, -70.75, -69.25, -68.75), latitude = c(-54.75,
>>> -54.75, -54.75, -54.25, -54.25, -54.25, -53.75, -53.75, -53.75,
>>> -53.75), GDP = c(1.683046, 0.3212307, 0.0486207, 0.1223268, 0.0171909,
>>> 0.0062104, 0.22379, 0.1406729, 0.0030038, 0.0057422)), .Names =
>>> c("longitude",
>>> "latitude", "GDP"), row.names = c(4L, 17L, 30L, 43L, 56L, 69L,
>>> 82L, 95L, 108L, 121L), class = "data.frame")
>>>
>>> I would like to aggregate the data 1 degree by 1 degree. I understand
>>> that
>>> the first step is to convert to raster. I have tried:
>>>
>>> rasterDF <- rasterFromXYZ(temp)
>>> r <- aggregate(rasterDF,fact=2, fun=sum)
>>>
>>> But this does not seem to work. Could anyone help me out please? Thank
>>> you
>>> in advance.
>>>
>>> Sincerely,
>>>
>>> Milu
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posti
>>> ng-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] rgl does not plot

2017-01-19 Thread George Trojan - NOAA Federal
I have installed package rgl without any problems. I can load the library,
issue commands from console without any errors showing up, however I can't
get anything plotted. Example session:

> library(rgl)
> plot3d(rnorm(100), rnorm(100), rnorm(100))
> rgl.quit()
> library(rgl)
> .check3d()
glX
 1
> plot3d(rnorm(100), rnorm(100), rnorm(100))
> > open3d()
glX
 2
> plot3d(rnorm(100), rnorm(100), rnorm(100))
> rgl.quit()

.check3d() and open3d() open a small window ~8x8 cm, copying desktop
background under it, which stays there when the window is moved. plot3d()
does not do anything. rgl.quit() closes the windows, as expected.

I am running Fedora 24 Scientific, NVIDIA video card with NVIDIA
proprietory driver that supports GLX. Any idea where to look for a solution?

George

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 studio server vs R server and Small computer to run R

2017-01-19 Thread Ista Zahn
Hi John,

I don't think this is the right place to find information about
RStudio or Microsoft products. If you re-phrase the question in terms
of what you want to accomplish rather than whether RStudio or
Microsoft is better perhaps people here will give you some
suggestions.

Best,
Ista

On Wed, Jan 18, 2017 at 12:03 PM, John Sorkin
 wrote:
> Please forgive my resending this help request. I sent it two days ago. To 
> date I have not received any responses.
> Thank you,
> John
>
>
> I am looking for a small computer low power that I make available on the web 
> that will run R studio server or R server
>
> 1) can anyone recommend a computer?
>
> 2) can anyone let me know the advantages and disadvantages of R studio server 
> and R server?
>
> Thank you
>
> John
>
>
> John David Sorkin M.D., Ph.D.
>
> Professor of Medicine
>
> Chief, Biostatistics and Informatics
>
>
> University of Maryland School of Medicine Division of Gerontology and 
> Geriatric Medicine
>
>
> Baltimore VA Medical Center
>
>
> 10 North Greene Street
>
>
> GRECC (BT/18/GR)
>
>
> Baltimore, MD 21201-1524
>
>
> (Phone) 410-605-7119
>
> (Fax) 410-605-7913 (Please call phone number above prior to faxing)
> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and 
> Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing)
>
> Confidentiality Statement:
> This email message, including any attachments, is for ...{{dropped:12}}

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] T tests on multiple groups

2017-01-19 Thread Jim Lemon
Hi Ed,
It's little hard to work out exactly what you want, but here's a guess:

esdf<-data.frame(GENO=rep(c("control","A","B","AB"),each=20),
 age=rep(c(10,20),40),OBS=runif(80,1,21))
for(age in c(10,20)) {
 for(geno in c("A","B","AB"))
  print(t.test(OBS~GENO,esdf[esdf$age==age &
   esdf$GENO %in% c("control",geno),]))
}

Note that this is not a good way to use t.test, nor a good way to
analyze data like this. Look at defining sensible contrasts and using
ANOVA or a similar approach.

Jim

On Fri, Jan 20, 2017 at 5:20 AM, Ed Siefker  wrote:
> I have a data set with observations on groups with multiple variables.
> Let's call them GENO and AGE.  I have control and test genotypes
> and two different ages.  It is only meaningful to compare control and
> test within the same age.
>
> I'd like to get the p value for each group compared back to control
> of the appropriate age.  T-test requires that the grouping factor has
> exactly two levels.   How can I do this efficiently?
>
> I was hoping something like ttest(OBS ~ GENO * AGE, mydata) would work.
> Is there something I can do with tapply() or aggregate() to do this?
> I'd like to end up with a table that looks like this:
>
> GENOAgeOBSp.val
> control101.11
> control100.91
> control202.11
> control201.91
> A10110.01224066
> A1090.01224066
> A20210.003102783
> A20190.003102783
> B1040.057714305
> B1060.057714305
> B20140.005923285
> B20160.005923285
> AB1010.698488655
> AB101.10.698488655
> AB2020.552786405
> AB202.20.552786405
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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 -- To UNSUBSCRIBE and more, see
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] Hyperbola formula

2017-01-19 Thread Therneau, Terry M., Ph.D.
This simple form of a hyperbola is not well known.  I find it useful for change point 
models: since the derivative is continuous it often behaves better in a maximizer.


h1 <- function(x, b, k=3)  .5 * b * (x + sqrt(x^2 + k^2))

Function h1() has asymptotes of y=0 to the left of 0 and y=x to the right of 0.  The 
parameter k controls how tightly the curve bends at zero.


A generalization is
h2 <- function (x, b, k=3) {
z <- x - b[4]
b[1] + b[2]*z + .5*b[3]* (z + sqrt(z^2 + k^2))
}
b[1] and b[2] are the intercept and slope of the left portion of the curve, b[4] is the 
inflection point, and b[3] is the change in slope at the inflection point.


The main downside is that k is arbitrary. I simply choose it to "look right", though it 
too could be part of an optimization.


Terry Therneau

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 studio server vs R server and Small computer to run R

2017-01-19 Thread John McKown
On Wed, Jan 18, 2017 at 11:03 AM, John Sorkin 
wrote:

> Please forgive my resending this help request. I sent it two days ago. To
> date I have not received any responses.
> Thank you,
> John
>
>
> I am looking for a small computer low power that I make available on the
> web that will run R studio server or R server
>
> 1) can anyone recommend a computer?
>

The Raspberry Pi 3 runs a version of Debian. It is quite small. Mine runs a
BCM2709 processor. That's a
​64 bit ARM processor. HOWEVER! The Debian that I have to run is only 32
bit.  It has 1 GiB of RAM and 32 GiB of flash memory which is the disk. It
runs 1.2 Ghz. It has 4 USB ports so you could plug in a USB connected disk,
if you need more local disk space.


https://www.raspberrypi.org/products/raspberry-pi-3-model-b/



>
> 2) can anyone let me know the advantages and disadvantages of R studio
> server and R server?
>

​Sorry, I only use the basic R.



>
> Thank you
>
> John
>
> John David Sorkin M.D., Ph.D.
>
>
>


-- 
There’s no obfuscated Perl contest because it’s pointless.

—Jeff Polk

Maranatha! <><
John McKown

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] reading data

2017-01-19 Thread MacQueen, Don
Try asking on R-sig-geo mailing list

Also, state what package(s) you are using, and include what you have already 
tried.

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062


On 1/19/17, 10:53 AM, "R-help on behalf of lily li" 
 wrote:

Hi R users,

I'm trying to open netcdf files in R. Each nc file has daily climate
measurements for a whole year, covering the whole US. How to limit the file
to a specific rectangle? Thanks.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 -- To UNSUBSCRIBE and more, see
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] reading data

2017-01-19 Thread lily li
Hi R users,

I'm trying to open netcdf files in R. Each nc file has daily climate
measurements for a whole year, covering the whole US. How to limit the file
to a specific rectangle? Thanks.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] help using tryCatch

2017-01-19 Thread William Dunlap via R-help
The 'error' argument to tryCatch must be a function (of one argument,
the exception).  Its return value will be the return value of tryCatch
if there is an error.  Hence you should change the present
error = return(TBAPrice)
to
error = function(exception) TBAPrice

You can use
error = function(exception) return(TBAPrice)
if you prefer to use explicit return statements.

You could also examine conditionMessage(exception) or class(exception)
to see if it is the error you expect.

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Thu, Jan 19, 2017 at 8:39 AM, Glenn Schultz  wrote:
> All,
> I have  a function that I would like to return 0 or NA on unit root error
> but I cannot figure out how to get tryCatch to work.  I have followed the
> examples in the R documentation as well as some online but I am missing
> something.  If I added the tryCatch code I only get the error value.  Any
> help is appreciated
>
> Glenn
>
> FindATOMSPrice <- function(StartPrice,
> TBAPrice,
> PriceInterval,
> CurrFactor,
> PrevFactor,
> CarryAdj,
> PDReturn,
> CPNReturn,
> MTDReturn){
> ATOMSReturn <- function(ClosePrice,
> StartPrice,
> CurrFactor,
> PrevFactor,
> PDReturn, CPNReturn, MTDReturn){
> SurvivalFactor = CurrFactor/PrevFactor
> PrxReturn = ((ClosePrice - StartPrice)/StartPrice) * SurvivalFactor
> ATOMSReturn = sum(PrxReturn, PDReturn, CPNReturn)
> return(ATOMSReturn - MTDReturn)
> }
> TBALow = TBAPrice - PriceInterval
> TBAHigh = TBAPrice + PriceInterval
>
> CleanPrice = #tryCatch({
> uniroot(ATOMSReturn,
> interval = c(TBALow, TBAHigh),
> tol = .1,
> StartPrice = StartPrice,
> CurrFactor = CurrFactor,
> PrevFactor = PrevFactor,
> PDReturn = PDReturn,
> CPNReturn = CPNReturn,
> MTDReturn = MTDReturn)$root
> #}, error = return(TBAPrice))
> return(CleanPrice - CarryAdj)
> }
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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 -- To UNSUBSCRIBE and more, see
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] T tests on multiple groups

2017-01-19 Thread Ed Siefker
I have a data set with observations on groups with multiple variables.
Let's call them GENO and AGE.  I have control and test genotypes
and two different ages.  It is only meaningful to compare control and
test within the same age.

I'd like to get the p value for each group compared back to control
of the appropriate age.  T-test requires that the grouping factor has
exactly two levels.   How can I do this efficiently?

I was hoping something like ttest(OBS ~ GENO * AGE, mydata) would work.
Is there something I can do with tapply() or aggregate() to do this?
I'd like to end up with a table that looks like this:

GENOAgeOBSp.val
control101.11
control100.91
control202.11
control201.91
A10110.01224066
A1090.01224066
A20210.003102783
A20190.003102783
B1040.057714305
B1060.057714305
B20140.005923285
B20160.005923285
AB1010.698488655
AB101.10.698488655
AB2020.552786405
AB202.20.552786405

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 using tryCatch

2017-01-19 Thread Glenn Schultz

All,
I have  a function that I would like to return 0 or NA on unit root error but I 
cannot figure out how to get tryCatch to work.  I have followed the examples in 
the R documentation as well as some online but I am missing something.  If I 
added the tryCatch code I only get the error value.  Any help is appreciated

Glenn

FindATOMSPrice <- function(StartPrice,
TBAPrice,
PriceInterval,
CurrFactor,
PrevFactor,
CarryAdj,
PDReturn,
CPNReturn,
MTDReturn){
ATOMSReturn <- function(ClosePrice,
StartPrice,
CurrFactor,
PrevFactor,
PDReturn, 
CPNReturn, 
MTDReturn){

SurvivalFactor = CurrFactor/PrevFactor
PrxReturn = ((ClosePrice - StartPrice)/StartPrice) * SurvivalFactor
ATOMSReturn = sum(PrxReturn, PDReturn, CPNReturn)
return(ATOMSReturn - MTDReturn)
}
TBALow = TBAPrice - PriceInterval
TBAHigh = TBAPrice + PriceInterval

CleanPrice = 
#tryCatch({

uniroot(ATOMSReturn,
interval = c(TBALow, TBAHigh),
tol = .1,
StartPrice = StartPrice,
CurrFactor = CurrFactor,
PrevFactor = PrevFactor,
PDReturn = PDReturn,
CPNReturn = CPNReturn,
MTDReturn = MTDReturn)$root
#}, error = return(TBAPrice))
return(CleanPrice - CarryAdj)
}
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] xvfb? cron job updates R packages, fails on some requiring X11

2017-01-19 Thread Dirk Eddelbuettel

Paul,

Just prefix the command as you would with, say, /usr/bin/time.  An example is 
here:

  
https://github.com/RcppCore/rcpp-logs/blob/master/scripts/runRcppDepends.r#L140L-L142

from the script I use to test all Rcpp dependencies -- now over 900 -- 
unattended.

Some packages also need OpenGL which the default does not give you. But the
r-cran.mk script building several hundred r-cran-* package for the Debian and
Ubuntu distros -- as well as several _thousand_ r-cran-* packages via Michael
Rutter's repos for Ubuntu, and included in every installation, does this:


  ## xvfb-run with GL extension and default resolution
  xvfbSrvArgs   = -screen 0 1024x768x24 -ac +extension GLX +render -noreset

  [...]

if test -f /usr/bin/xvfb-run; then  \
$(makeFlagsCall) xvfb-run -a -n 20  \
  -s "${xvfbSrvArgs}"   \
R CMD INSTALL -l $(debRlib) --clean \
$(extraInstallFlags) .  \
$(builttimeStamp)   \
;   \


I guess you can piece the rest together.  Now, if you just used Ubuntu LTS
instead of insisting on CentOS you wouldn't even have to compile them
locally.  Might be worth a consideration or test deployment.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] xvfb? cron job updates R packages, fails on some requiring X11

2017-01-19 Thread Duncan Murdoch

On 19/01/2017 11:52 AM, Paul Johnson wrote:

In Centos 7 systems, I wrote a script that runs on the cron and I
notice some package updates and installs fail like this:


Error : .onLoad failed in loadNamespace() for 'iplots', details:
  call: .jnew("org/rosuda/iplots/Framework")
  error: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an
operation which requires it.
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/share/R/library/iplots’
* restoring previous ‘/usr/share/R/library/iplots’


I can log in interactively and run  the same install successfully.

I understand I need something like xvfb to simulate an X11 session,
but I don't understand how to make it work.  Can one of you give me an
idiot's guide on what to do?

pj




I don't know if iplots offers this, but a package should be able to work 
in a non-X11 environment.  rgl does it by checking the RGL_USE_NULL 
environment variable.


Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] xvfb? cron job updates R packages, fails on some requiring X11

2017-01-19 Thread Paul Johnson
In Centos 7 systems, I wrote a script that runs on the cron and I
notice some package updates and installs fail like this:


Error : .onLoad failed in loadNamespace() for 'iplots', details:
  call: .jnew("org/rosuda/iplots/Framework")
  error: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an
operation which requires it.
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/share/R/library/iplots’
* restoring previous ‘/usr/share/R/library/iplots’


I can log in interactively and run  the same install successfully.

I understand I need something like xvfb to simulate an X11 session,
but I don't understand how to make it work.  Can one of you give me an
idiot's guide on what to do?

pj


-- 
Paul E. Johnson   http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu

To write to me directly, please address me at pauljohn at ku.edu.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Fwd: Need help in exporting R apriori rules to Excel

2017-01-19 Thread Sarah Goslee
Hi,

You need to reply to the list as well as to me; I can't provide private R help.

I don't know what more help you need: I told you what function to use,
and what google search I used to find the answer.

If you have additional problems you need to be more specific in your
question. This link might help:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Sarah

On Thu, Jan 19, 2017 at 1:35 AM, Edward Tamil  wrote:
> hi
>
> Thanks for your reply.
>
> Im new to R. started learning from Web tutorials.below is the code. please
> help me.
>
> rm(list=ls())
> setwd("D:/POSable/Mahimm sir/Market Basket Analysis")
> tr <- read.csv("Noodles.csv")
> options(max.print=1000)
> str(tr)
> tr
> i <- split(tr$item, tr$id)
> head(i)
> library("arules")
> txn <- as(i, "transactions")
> basket_rules <- apriori(txn, parameter = list(sup = 0.001, conf = 0.01,
> target="rules"))
> DT <- data.frame(inspect(sort(basket_rules, by="support")))
> write.table(file = "Noodle_rules.csv",DT,sep = ",", col.names = NA,
> qmethod = "double")
>
>
>
>
> On Wed, Jan 18, 2017 at 7:44 PM, Sarah Goslee 
> wrote:
>>
>> I believe you need to convert them to a data frame before you can use
>> any data frame export functions to save them to disk. See ?as
>>
>> I'm assuming that you are using the arules package; your question is
>> incomplete.
>>
>> I've never used arules myself; I googled "rhelp export apriori rules"
>>
>> Sarah
>>
>> On Wed, Jan 18, 2017 at 3:09 AM, Edward Tamil  wrote:
>> > Hi Sir,
>> >
>> >
>> > Need help in exporting R apriori rules to Excel. i tried write.csv
>> > write.table write.csv2
>> >
>> > only exporting less than 500 rules.
>> >
>> > unable to export Large Data.
>> >
>> >
>> > " No Error Msg" File size is "0"
>> >
>> > --
>> >
>> > *Edward *
>> >
>> >
>> >
>> >
>> >
>
>
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] non-parametric manova with post-hoc test

2017-01-19 Thread Bert Gunter
You really need to go to the literature. The analysis of rank
transformed data has a long history going back to the 1970's/80's, at
least. See, e.g.

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjDg_uGuM7RAhWmrVQKHaYRDb0QFggcMAA&url=http%3A%2F%2Fpeople.umass.edu%2Fbioep740%2Ftopics%2Famstat-1985-iman.pdf&usg=AFQjCNHcbe_1R6vRtMSBrMW9YIeFQxjb1Q&sig2=9JeOaP1f61m7REfmScefVg

There is even a Wikipedia entry for "Anova on Ranks".
So you really really should do some homework.

Moreover, statistical discussions are largely OT here.
stats.stackexchange.com is a more appropriate list if you wish to
continue online.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Wed, Jan 18, 2017 at 11:19 PM,   wrote:
> Dear Brian,
> Thank you for your answer.
> Another thing that came to my mind: Would it be possible just to separately 
> rank-transform my 3 dependent  variables and then to conduct a normal MANOVA 
> on this data?
>
>
> Thanks,
> Mike
> Eisenring Michael, Msc.
> PhD Student
>
> Federal Department of Economic Affairs, Education and Research
> EAER
> Agroecology and Environment
> Biosafety
>
> Reckenholzstrasse 191, CH-8046 Zürich
> Tel. +41 44 37 77181
> Fax +41 44 37 77201
> michael.eisenr...@agroscope.admin.ch
> www.agroscope.ch
>
> Von: Cade, Brian [mailto:ca...@usgs.gov]
> Gesendet: Mittwoch, 18. Januar 2017 18:20
> An: Eisenring Michael Agroscope 
> Cc: r-help@r-project.org
> Betreff: Re: [R] non-parametric manova with post-hoc test
>
> You could try a multi-response permutation procedure (MRPP) for multivariate 
> hypothesis testing (null is groups come from a common distribution) without 
> resorting to ranks.  There are no automated multiple comparison procedures, 
> but one could either look at pairwise contrasts of group (if that is what you 
> are implying by post-hoc testing) with some sort of correction procedure for 
> multiple comparisons (e.g., Holm's sequential procedure).  Or similarly, 
> comparisons with different subsets of the multivariate outcome variables 
> (again, adjusting for multiple comparisons) across the grouping structure.  
> There are several R packages that I think implement MRPP but the Blossom 
> package might be one of the better implementations in terms of alternatives 
> provided (including permutation version of Hotelling's test).
>
> Brian
>
> Brian S. Cade, PhD
>
> U. S. Geological Survey
> Fort Collins Science Center
> 2150 Centre Ave., Bldg. C
> Fort Collins, CO  80526-8818
>
> email:  ca...@usgs.gov
> tel:  970 226-9326
>
>
> On Wed, Jan 18, 2017 at 10:00 AM, 
> mailto:michael.eisenr...@agroscope.admin.ch>>
>  wrote:
> Good day,
> I am looking for a way to perform a non parametric manova and to analyze the 
> result using post-hoc tests (an equivalent of the kruskal wallis test for 
> anova)
>
> In my book (discovering statistic using R) two tests are described Munzel and 
> Brunners method (mulrank) and Choi and Mardens test (cmanova). Both are from 
> the package WRS which unfortunately does not exist anymore (and WRS2 is not 
> containing these tests). Furthermore the test do to my knowledge not allow 
> post-hoc analyses-
>
> I would be grateful for your help
>
> Best,
> Mike
>
> Eisenring Michael, Msc.
> PhD Student
>
> Federal Department of Economic Affairs, Education and Research
> EAER
> Agroecology and Environment
> Biosafety
>
> Reckenholzstrasse 191, CH-8046 Zürich
> Tel. +41 44 37 77181
> Fax +41 44 37 77201
> michael.eisenr...@agroscope.admin.ch>
> www.agroscope.ch
>
>
> [[alternative HTML version deleted]]
>
>
> __
> R-help@r-project.org mailing list -- To 
> UNSUBSCRIBE and more, see
> 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.
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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 -- To UNSUBSCRIBE and more, see
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-c

Re: [R] non-parametric manova with post-hoc test

2017-01-19 Thread Bruno C
bruno.rproj...@gmail.com

Em qui, 19 de jan de 2017 05:22, 
escreveu:

> Dear Brian,
> Thank you for your answer.
> Another thing that came to my mind: Would it be possible just to
> separately rank-transform my 3 dependent  variables and then to conduct a
> normal MANOVA on this data?
>
>
> Thanks,
> Mike
> Eisenring Michael, Msc.
> PhD Student
>
> Federal Department of Economic Affairs, Education and Research
> EAER
> Agroecology and Environment
> Biosafety
>
> Reckenholzstrasse 191, CH-8046 Zürich
> Tel. +41 44 37 77181
> Fax +41 44 37 77201
> michael.eisenr...@agroscope.admin.ch michael.eisenr...@agroscope.admin.ch>
> www.agroscope.ch
>
> Von: Cade, Brian [mailto:ca...@usgs.gov]
> Gesendet: Mittwoch, 18. Januar 2017 18:20
> An: Eisenring Michael Agroscope 
> Cc: r-help@r-project.org
> Betreff: Re: [R] non-parametric manova with post-hoc test
>
> You could try a multi-response permutation procedure (MRPP) for
> multivariate hypothesis testing (null is groups come from a common
> distribution) without resorting to ranks.  There are no automated multiple
> comparison procedures, but one could either look at pairwise contrasts of
> group (if that is what you are implying by post-hoc testing) with some sort
> of correction procedure for multiple comparisons (e.g., Holm's sequential
> procedure).  Or similarly, comparisons with different subsets of the
> multivariate outcome variables (again, adjusting for multiple comparisons)
> across the grouping structure.  There are several R packages that I think
> implement MRPP but the Blossom package might be one of the better
> implementations in terms of alternatives provided (including permutation
> version of Hotelling's test).
>
> Brian
>
> Brian S. Cade, PhD
>
> U. S. Geological Survey
> Fort Collins Science Center
> 2150 Centre Ave., Bldg. C
> Fort Collins, CO  80526-8818
>
> email:  ca...@usgs.gov
> tel:  970 226-9326
>
>
> On Wed, Jan 18, 2017 at 10:00 AM,  > wrote:
> Good day,
> I am looking for a way to perform a non parametric manova and to analyze
> the result using post-hoc tests (an equivalent of the kruskal wallis test
> for anova)
>
> In my book (discovering statistic using R) two tests are described Munzel
> and Brunners method (mulrank) and Choi and Mardens test (cmanova). Both are
> from the package WRS which unfortunately does not exist anymore (and WRS2
> is not containing these tests). Furthermore the test do to my knowledge not
> allow post-hoc analyses-
>
> I would be grateful for your help
>
> Best,
> Mike
>
> Eisenring Michael, Msc.
> PhD Student
>
> Federal Department of Economic Affairs, Education and Research
> EAER
> Agroecology and Environment
> Biosafety
>
> Reckenholzstrasse 191, CH-8046 Zürich
> Tel. +41 44 37 77181
> Fax +41 44 37 77201
> michael.eisenr...@agroscope.admin.ch michael.eisenr...@agroscope.admin.ch> michael.eisenr...@agroscope.admin.ch michael.eisenr...@agroscope.admin.ch>>
> www.agroscope.ch
>
>
> [[alternative HTML version deleted]]
>
>
> __
> R-help@r-project.org mailing list -- To
> UNSUBSCRIBE and more, see
> 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.
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.