Re: [R] FlexBayes installation from R-Forge Problem R 3.2.2

2015-09-28 Thread David Katz
Pascal,

Oops. Thanks!


*David Katz*| IAG, TIBCO Spotfire

O: 1.541.203.7084 | M: 1.541.324.7417



On Mon, Sep 28, 2015 at 5:47 PM, Pascal Oettli  wrote:

> You misspelled the web address. It is "R-project", not "R.project".
> Thus, the command line should be:
>
> install.packages("FlexBayes", repos="http://R-Forge.R-project.org;)
>
> Regards,
> Pascal
>
> On Mon, Sep 28, 2015 at 9:17 AM, Davidwkatz  wrote:
> > I tried to install FlexBayes like this:
> >
> > install.packages("FlexBayes", repos="http://R-Forge.R.project.org;) but
> got
> > errors:
> >
> > Here's the transcript in R:
> >
> > R version 3.2.2 (2015-08-14) -- "Fire Safety"
> > Copyright (C) 2015 The R Foundation for Statistical Computing
> > Platform: x86_64-w64-mingw32/x64 (64-bit)
> >
> > R is free software and comes with ABSOLUTELY NO WARRANTY.
> > You are welcome to redistribute it under certain conditions.
> > Type 'license()' or 'licence()' for distribution details.
> >
> >   Natural language support but running in an English locale
> >
> > R is a collaborative project with many contributors.
> > Type 'contributors()' for more information and
> > 'citation()' on how to cite R or R packages in publications.
> >
> > Type 'demo()' for some demos, 'help()' for on-line help, or
> > 'help.start()' for an HTML browser interface to help.
> > Type 'q()' to quit R.
> >
> >> install.packages("FlexBayes", repos="http://R-Forge.R.project.org;)
> > Installing package into ‘C:/Users/dkatz/R/win-library/3.2’
> > (as ‘lib’ is unspecified)
> > Error: Line starting ' >
> >
> > Any help will be much appreciated!
> >
> > Thanks,
> >
> >
> >
> > --
> > View this message in context:
> http://r.789695.n4.nabble.com/FlexBayes-installation-from-R-Forge-Problem-R-3-2-2-tp4712861.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > __
> > 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.
>
>
>
> --
> Pascal Oettli
> Project Scientist
> JAMSTEC
> Yokohama, Japan
>

[[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] Creating World Map with Points

2015-09-28 Thread Lorenzo Isella

Dear All,
Please have a look at the snippet at the end of the email.
Essentially, I am trying to combine google maps with ggplot2.
The idea is to simply plot some points, whose size depend on a scalar,
on a google map.
My question is how I can extend the map in the snippet below in order
to plot the whole world.
Even at the lowest allowed zoom (=2), there are some continents left
out.
I cannot believe there is not a workaround for this while using the
google maps, but so far I have not made any progress at all.
Any suggestion is welcome.
Cheers

Lorenzo


##
library(ggmap)
map <- get_map(location = 'India', zoom = 2)

n <- 1000

set.seed(1234)

long <- runif(n,-180, 180)

lat <- runif(n,-90, 90)

size <- runif(n, 1,5)

data <- cbind(long, lat, size)

data <- as.data.frame(data)

gpl <- ggmap(map) +
geom_point(data = data,aes(x = long, y = lat),size=data$size,  alpha
=1, color="blue",show.legend  = F)


ggsave("test-map.pdf", gpl,width=10,height=10)

__
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] How to find out if two cells in a dataframe belong to the same pre-specified factor-level

2015-09-28 Thread Adams, Jean
Here's one approach that works.  I made some changes to the code you
provided.  Full working example code given below.

library(reshape)
library(ggplot2)
library(dplyr)

dist1 <- matrix(runif(16), 4, 4)
dist2 <- matrix(runif(16), 4, 4)
rownames(dist1) <- colnames(dist1) <- paste0("A", 1:4)
rownames(dist2) <- colnames(dist2) <- paste0("A", 1:4)
m1 <- melt(dist1)
m2 <- melt(dist2)
# I changed the by= argument here
final <- full_join(m1, m2, by=c("X1", "X2"))

# I made some changes to keep spcs character and grps factor
species <- data.frame(spcs=paste0("A", 1:4),
  grps=as.factor(c(rep("cat", 2), (rep("dog", 2, stringsAsFactors=FALSE)

# define new variables for final indicating group membership
final$g1 <- species$grps[match(final$X1, species$spcs)]
final$g2 <- species$grps[match(final$X2, species$spcs)]
final$group <- as.factor(with(final, ifelse(g1==g2, as.character(g1),
"dif")))

# plot just the rows with matching groups
ggplot(final[final$group!="dif", ], aes(value.x, value.y, col=group)) +
  geom_point()
# plot all the rows
ggplot(final, aes(value.x, value.y, col=group)) + geom_point()

Jean


On Sun, Sep 27, 2015 at 4:22 PM,  wrote:

> Dear list,
> I really couldnt find a better way to describe my question, so please bear
> with me.
>
> To illustrate my problem, i have a matrix with ecological distances (m1)
> and one with genetic distances (m2) for a number of biological species. I
> have merged both matrices and want to plot both distances versus each
> other, as illustrated in this example:
>
> library(reshape)
> library(ggplot2)
> library(dplyr)
>
> dist1 <- matrix(runif(16),4,4)
> dist2 <- matrix(runif(16),4,4)
> rownames(dist1) <- colnames(dist1) <- paste0("A",1:4)
> rownames(dist2) <- colnames(dist2) <- paste0("A",1:4)
>
> m1 <- melt(dist1)
> m2 <- melt(dist2)
>
> final <- full_join(m1,m2, by=c("Var1","Var2"))
> ggplot(final, aes(value.x,value.y)) + geom_point()
>
> Here is the twist:
> The biological species belong to certain groups, which are given in the
> dataframe `species`, for example:
>
> species <- data.frame(spcs=as.character(paste0("A",1:4)),
>   grps=as.factor(c(rep("cat",2),(rep("dog",2)
>
> I want to check if a x,y pair in final (as in `final$Var1`, `final$Var2`)
> belongs to the same group of species (here "cat" or "dog"), and then want
> to color all groups specifically in the x,y-scatterplot.
> Thus, i need an R translation for:
>
> final$group <- If (final$Var1 and final$Var2) belong to the same group as
> specified
>   in species, then assign the species group here, else do nothing or
> assign NA
>
> so i can proceed with
>
> ggplot(final, aes(value.x,value.y, col=group)) + geom_point()
>
> So, in the example, the pairs A1-A1, A1-A2, A2-A1, A2-A2 should be
> identified as "both cats", hence should get the factor "cat".
>
> Thank you very much!
>
>
> Tim
>
> __
> 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.


Re: [R] a question on write.table

2015-09-28 Thread Giorgio Garziano
Try this:

X<-c("A","B","C","D","E")
Y<-c(0,1,2,3,4)

for (i in 0:3) {
  Y<-Y+i
  data<-data.frame(X,Y)
  fe.flag <- file.exists("test.csv")
  write.table(data, "test.csv", row.names = FALSE, col.names = !fe.flag, 
sep=";", append = fe.flag)
}




[[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] Singular Spectrum Analysis Plotting Skipping in a loop, but individually it works

2015-09-28 Thread കുഞ്ഞായി kunjaai
Dear Anton & Michael,

 Thanks a lot for your  nice suggestion,

Now its working

cheers  :)

On Mon, Sep 28, 2015 at 1:24 PM, Michael Dewey 
wrote:

> Dear Dileep
>
> What happens if you explicitly print it by wrapping the plot command in
> print(   )
>
>
> On 28/09/2015 07:01, കുഞ്ഞായി kunjaai wrote:
>
>> Dear all,
>>
>> I am trying to plot  Spectrum of Singular Values using "Rssa" package.
>>
>> I am trying to plot singular spectrum plot  inside a loop, it is not
>> plotting, but when I am trying to plot individually in terminal it works,
>> and I can save this as png files.
>>
>> My code is given below:
>>
>> *# --Calculating and plotting  Spectrum of Singular Values of
>> Control-#*
>> library(ncdf)
>> library(Rssa)
>> season_list <-c('YEAR', 'DJF', 'JJA', 'SON', 'MAM')
>> zone_list <-c('ALLIN', 'WCIND', 'IPIND', 'ECIND', 'NEIND', 'NCIND',
>> 'NWIND', 'WHIND')
>>
>> for (sns in 1:length(season_list)){
>> for (rgn in 1:length(zone_list)){
>> var_noise<-paste(zone_list[rgn], "_",  season_list[sns], sep = "")
>> noise1<-get.var.ncdf(f_noise1, var_noise)
>> noise2<-get.var.ncdf(f_noise2, var_noise)
>> # Calculating Covariance Matrix from 'noise1' matrix
>> cv_noise_1 = noise1%*%t(noise1)
>> sigular_spectrum = ssa(cv_noise_1, svd.method = c("eigen"))
>>
>> out_ssa_png =
>>
>> paste("/home/dileep/WORK/Research_wind/CMIP_PiCOntrol_Expiriments/Homogenious_zone/homogenious_tempreture_zone/Homogenous_temp_Codes/Optimal_fingerprint_code/R/ECOF-package/SSA_noise_plots/SSA_",
>> zone_list[rgn], "_",  season_list[sns], "_SET_1.png", sep = "")
>>
>> png(out_ssa_png, width= 6, height= 7.0, units = "in", res= 1200,
>> pointsize = 3)
>> print ("Created PNG file")
>> titl = paste(zone_list[rgn],  season_list[sns], sep = " ")
>> plot(sigular_spectrum , main=titl)
>> dev.off()
>> print ("Done !")
>> }
>> }
>>
>> *####*
>>
>> Thank you in advance
>>
>>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html
>



-- 
DILEEPKUMAR. R
J R F, IIT DELHI

[[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] Find Crossover Points of Two Spline Functions

2015-09-28 Thread Bert Gunter
Use ?uniroot to do it numerically instead of polyroot()?

Cheers,
Bert
Bert Gunter

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
   -- Clifford Stoll


On Mon, Sep 28, 2015 at 9:17 AM, Ben Bolker  wrote:
> Dario Strbenac  uni.sydney.edu.au> writes:
>
>>
>> Good day,
>>
>> I have two probability densities, each with a function determined
>> by splinefun(densityResult[['x']],
>> densityResult[['y']], "natural"), where densityResult is the
>> output of the density function in stats.
>> How can I determine all of the x values at which the densities cross ?
>>
>
>   My initial thought was this is non-trivial, because the two densities could
> cross (or nearly-but-not-quite cross) at an unlimited number of points.
> I thought it would essentially boils down to "how do I find all
> the roots of an arbitrary (continuous, smooth) function?
>
>   However, after thinking about it for a few more seconds I realize
> that at least the functions are piecewise cubic.  I still don't see
> a *convenient* way to do it ... if the knots were all coincident between
> the two densities (maybe you could constrain them to be so?) then you
> just have a difference of cubics within each segment, and you can use
> polyroot() to find the roots (and throw out any that are complex or
> don't fall within the segment).
>   If the knots are not coincident it's more of a pain but you should
> still be able to do it by considering overlapping segments ...
>
> __
> 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.


Re: [R] Hide Legend

2015-09-28 Thread Giorgio Garziano
library(quantmod)



getSymbols("YHOO")

chartSeries(YHOO, theme="white", type='line')

chartSeries(YHOO, theme="white", type='line', TA=NULL)

chartSeries(Cl(YHOO), theme="white", type='line')

chartSeries(YHOO, theme="white", type='line', name="")


chartSeries(YHOO, type='line', theme='white')

b <- BBands(HLC(YHOO))
addTa(b, legend=NULL)

--

Giorgio Garziano



[[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] Hide Legend

2015-09-28 Thread bgnumis bgnum
Hi all,

I want to plot with quantmode but I want to ommit levels on Lavel, showing
only Last Price, not the bands (in the case f.e. in Bollinger Bands) ¿Is it
Possible? And to ommit hide all legend?

I dont find docutmentation or example.

[[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] Line in hist count

2015-09-28 Thread Adams, Jean
I'm not sure what you want when you refer to the "last value of f", but
perhaps this will help you out.  I simplified your example since the other
parts of the code you submitted (par, grid, title, etc.) do not have
anything to do with your question.

# some fake data for f
f <- rnorm(20)

# save the counts using default breaks
fhist <- hist(f, plot=FALSE)

# calculate the proportion
x <- fhist$counts/sum(fhist$counts)

# plot the results, and save the y values
b <- barplot(x, horiz=TRUE)

# add text to the bars
text(x, b, b, pos=2)

Jean


On Sun, Sep 27, 2015 at 4:51 PM, bgnumis bgnum  wrote:

> Hi, all
>
> I have discovered that with abline(h=dataf,col="red") can add a line as I
> want in this plot
>
> fhist<-hist(f,plot=FALSE)
> par(mar=c(6,0,6,6))
> barplot(fhist$counts/ sum(fhist$counts),axes=FALSE,
> space=0,horiz=TRUE,col="lightgray")
> grid()
> title("Marginal Distribution CDS vs. Ibex",font=4)
> abline(h=dataf,col="red")
>
> The thing is:
>
> ¿How can I display the associated fhist$counts/ sum(fhist$counts on the
> last value of f?
>
> 2015-09-26 23:31 GMT+02:00 bgnumis bgnum :
>
> > Hi all,
> >
> > Several time ago I used to work with R, now I´m returning to study and
> > work and searching old file I see that I used this code:
> >
> >
> > gfhist<-hist(gf,plot=FALSE)
> >
> > par(mar=c(6,0,6,6))
> >
> > barplot(gfhist$counts,axes=FALSE, space=0,horiz=TRUE,col="lightgray")
> >
> > grid()
> >
> > title("Marginal Distribution Lagged",font=4)
> >
> > The thing is I would line to plot a bar (horizontal and thing bar that
> > will be placed on the last gf data but on the barplot
> >
> > ¿Do you think is it possible? gf is a matrix.
> >
> >
> >
>
> [[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.

Re: [R] Find Crossover Points of Two Spline Functions

2015-09-28 Thread Bert Gunter
... (should have added)

However one might ask: Isn't this just a bit silly? The density()
function gives kernel density estimates (perhaps interpolated by
?approx -- see ?density) on as fine a grid as one likes, so why use
splines thereafter? And since these are density estimates -- i.e.
fitted approximations -- anyway, why search for "exact" solutions? Of
course I don't know the detailed context, but this whole question
sounds somewhat bogus.

Cheers,
Bert


Bert Gunter

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
   -- Clifford Stoll


On Mon, Sep 28, 2015 at 9:36 AM, Bert Gunter  wrote:
> Use ?uniroot to do it numerically instead of polyroot()?
>
> Cheers,
> Bert
> Bert Gunter
>
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
>-- Clifford Stoll
>
>
> On Mon, Sep 28, 2015 at 9:17 AM, Ben Bolker  wrote:
>> Dario Strbenac  uni.sydney.edu.au> writes:
>>
>>>
>>> Good day,
>>>
>>> I have two probability densities, each with a function determined
>>> by splinefun(densityResult[['x']],
>>> densityResult[['y']], "natural"), where densityResult is the
>>> output of the density function in stats.
>>> How can I determine all of the x values at which the densities cross ?
>>>
>>
>>   My initial thought was this is non-trivial, because the two densities could
>> cross (or nearly-but-not-quite cross) at an unlimited number of points.
>> I thought it would essentially boils down to "how do I find all
>> the roots of an arbitrary (continuous, smooth) function?
>>
>>   However, after thinking about it for a few more seconds I realize
>> that at least the functions are piecewise cubic.  I still don't see
>> a *convenient* way to do it ... if the knots were all coincident between
>> the two densities (maybe you could constrain them to be so?) then you
>> just have a difference of cubics within each segment, and you can use
>> polyroot() to find the roots (and throw out any that are complex or
>> don't fall within the segment).
>>   If the knots are not coincident it's more of a pain but you should
>> still be able to do it by considering overlapping segments ...
>>
>> __
>> 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] a question on write.table

2015-09-28 Thread Antonio Silva
Dear R users

I want to write a file that contains several data frames generated in a loop
ing.
I also want the column names be written to file only when it is created in
first loop.

In the example below, when I run each line separately without "for (i in
...) { }"  it works, but when I run the looping I get an error message

X<-c("A","B","C","D","E")
Y<-c(0,1,2,3,4)

for (i in 0:3) {
Y<-Y+i
data<-data.frame(X,Y)
ifelse(file.exists("test.csv"),
 write.table(data,"test.csv",row.names =
FALSE,col.names=FALSE,sep=";",append=TRUE),
 write.table(data,"test.csv",row.names = FALSE,sep=";")
)}

Error in ifelse(file.exists("test.csv"), write.table(data, "test.csv",  :
  substituto tem comprimento zero
Além disso: Warning message:
In rep(yes, length.out = length(ans)) :
  'x' is NULL so the result will be NULL

What is going wrong here? Thanks for any comments or suggestions.

All the best.

Antonio Olinto

[[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] ASA Statistical Computing & Statistical Graphics Award

2015-09-28 Thread Patrick Breheny

Statistical Computing and Statistical Graphics Sections
American Statistical Association

The Statistical Computing and Graphics Award

The ASA Sections of Statistical Computing and Statistical Graphics have 
established the Statistical Computing and Graphics Award to recognize an 
individual or team for innovation in computing, software, or graphics 
that has had a great impact on statistical practice or research.


The prize carries with it a cash award of $5,000 plus an allowance of up 
to $1,000 for travel to the annual Joint Statistical Meetings (JSM) 
where the award will be presented.


The prize-winning contribution will have had significant and lasting 
impact on statistical computing, software or graphics.  The Awards 
Committee depends on the American Statistical Association membership to 
submit nominations. Committee members will review the nominations and 
make the final determination of who, if any, should receive the award. 
The award may not be given to a sitting member of the Awards Committee 
or a sitting member of the Executive Committee of the Section of 
Statistical Computing or the Section of Statistical Graphics.


Nominations are due by December 15, 2015.  The award will be presented 
at the Joint Statistical Meetings in August 2016.


Nominations should be submitted as a complete packet, consisting of:

* nomination letter, no longer than four pages, addressing the impact of 
the nominee's contribution

* nominee's curriculum vita(e)
* maximum of four supporting letters, each no longer than two pages

Nominations and questions should be sent to the Awards Chair of the 
Statistical Computing Section at the e-mail address below.


Patrick Breheny
Department of Biostatistics
University of Iowa
patrick-breh...@uiowa.edu

--
Patrick Breheny
Assistant Professor
Department of Biostatistics
University of Iowa
N336 College of Public Health Building
319-384-1584

__
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] a question on write.table

2015-09-28 Thread David Winsemius

On Sep 28, 2015, at 11:31 AM, Antonio Silva wrote:

> Dear R users
> 
> I want to write a file that contains several data frames generated in a loop
> ing.
> I also want the column names be written to file only when it is created in
> first loop.
> 
> In the example below, when I run each line separately without "for (i in
> ...) { }"  it works, but when I run the looping I get an error message
> 
> X<-c("A","B","C","D","E")
> Y<-c(0,1,2,3,4)
> 
> for (i in 0:3) {
> Y<-Y+i
> data<-data.frame(X,Y)
> ifelse(file.exists("test.csv"),
> write.table(data,"test.csv",row.names =
> FALSE,col.names=FALSE,sep=";",append=TRUE),
> write.table(data,"test.csv",row.names = FALSE,sep=";")

The basic problem is that you are using ifelse(test , cons , alt) when you 
should be using if(test){cons}else{alt}

`ifelse` will evaluate both cons and alt. You don't want that to happen.

-- 
David.


> )}
> 
> Error in ifelse(file.exists("test.csv"), write.table(data, "test.csv",  :
>  substituto tem comprimento zero
> Além disso: Warning message:
> In rep(yes, length.out = length(ans)) :
>  'x' is NULL so the result will be NULL
> 
> What is going wrong here? Thanks for any comments or suggestions.
> 
> All the best.
> 
> Antonio Olinto
> 
>   [[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.

David Winsemius
Alameda, CA, USA

__
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] a question on write.table

2015-09-28 Thread ruipbarradas
Hello,

ifelse is a vectorized version of if/else, you want the normal if/else.

if(file.exists(... etc ...)
    [...]
else
    [...]

Hope this helps,

Rui Barradas
 

Citando Antonio Silva :

> Dear R users
>
> I want to write a file that contains several data frames generated in a
> loop
> ing.
> I also want the column names be written to file only when it is created
in
> first loop.
>
> In the example below, when I run each line separately without "for (i in
> ...) { }"  it works, but when I run the looping I get an error message
>
> X<-c("A","B","C","D","E")
> Y<-c(0,1,2,3,4)
>
> for (i in 0:3) {
> Y<-Y+i
> data<-data.frame(X,Y)
> ifelse(file.exists("test.csv"),
> write.table(data,"test.csv",row.names =
> FALSE,col.names=FALSE,sep=";",append=TRUE),
> write.table(data,"test.csv",row.names = FALSE,sep=";")
> )}
>
> Error in ifelse(file.exists("test.csv"), write.table(data, "test.csv", 
:
> substituto tem comprimento zero
> Além disso: Warning message:
> In rep(yes, length.out = length(ans)) :
> 'x' is NULL so the result will be NULL
>
> What is going wrong here? Thanks for any comments or suggestions.
>
> All the best.
>
> Antonio Olinto
>
>         [[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.htmland 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.

Re: [R] a question on write.table

2015-09-28 Thread Antonio Silva
Thanks Giorgio, David and Rui

With the suggestions my problem was solved in different ways.

Best regards

Antonio


2015-09-28 15:52 GMT-03:00 Giorgio Garziano :

> Try this:
>
> X<-c("A","B","C","D","E")
> Y<-c(0,1,2,3,4)
>
> for (i in 0:3) {
>   Y<-Y+i
>   data<-data.frame(X,Y)
>   fe.flag <- file.exists("test.csv")
>   write.table(data, "test.csv", row.names = FALSE, col.names = !fe.flag,
> sep=";", append = fe.flag)
> }
>
>
>
>
> [[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.
>



-- 
Antônio Olinto Ávila da Silva
Biólogo / Oceanógrafo
Instituto de Pesca (Fisheries Institute)
São Paulo, Brasil

[[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] merging tables based on both row and column names

2015-09-28 Thread Frank Schwidom

test1 <- (rbind(c(0.1,0.2),0.3,0.1))
rownames(test1)=c('y1','y2','y3')
colnames(test1) = c('x1','x2');
test2 <- (rbind(c(0.8,0.9,0.5),c(0.5,0.1,0.6)))
rownames(test2) = c('y2','y5')
colnames(test2) = c('x1','x3','x2')


lTest12 <- list( test1, test2)
namesRow <- unique( unlist( lapply( lTest12, rownames)))
namesCol <- unique( unlist( lapply( lTest12, colnames)))
tmp1 <- do.call( cbind, lapply( lTest12, function( x) as.vector( x[ match( 
namesRow, rownames( x)), match( namesCol, colnames( x))])))
tmp2 <- apply( tmp1, 1, list)
tmp3 <- lapply( tmp2, function( x) x[[1]][ !is.na( x[[1]])])
dimnames1 <- list( namesRow, namesCol)
tmp4 <- array( data= tmp3, dim= sapply( dimnames1, length), dimnames= dimnames1)

paste( tmp4)

 [1] "0.1" "c(0.3, 0.8)" "0.1" "0.5" "0.2"
 [6] "c(0.3, 0.5)" "0.1" "0.6" "numeric(0)"  "0.9"
[11] "numeric(0)"  "0.1"

tmp4
   x1x2x3   
y1 0.1   0.2   Numeric,0
y2 Numeric,2 Numeric,2 0.9  
y3 0.1   0.1   Numeric,0
y5 0.5   0.6   0.1  


Regards.


On 2015-09-28 18:46:18, C Lin wrote:
> Dear R users,
> 
> I am trying to merge tables based on both their row names and column names.
> My ultimate goal is to build a distribution table of values for each 
> combination of row and column names. 
> I have more test tables, more x's and y's than in the toy example below. 
> Thanks in advance for your help.
> 
> For example :
> test1 <- data.frame(rbind(c(0.1,0.2),0.3,0.1))
> rownames(test1)=c('y1','y2','y3')
> colnames(test1) = c('x1','x2');
> test2 <- data.frame(rbind(c(0.8,0.9,0.5),c(0.5,0.1,0.6)))
> rownames(test2) = c('y2','y5')
> colnames(test2) = c('x1','x3','x2')
> 
> test1
>x1   x2
> y1  0.1  0.2
> y2  0.3  0.3
> y3  0.1  0.1
> 
> test2
>x1   x3   x2
> y2  0.8  0.9  0.5
> y5  0.5  0.1  0.6
> 
> I would like to combine test1 and test2 such that if the column name and row 
> name are both the same they are combined.
> 
> combined_test
>x1  x2 x3
> y1  0.1  0.2   NA
> y2  (0.3,0.8)(0.3,0.5)  0.9
> y3  0.1  0.1   NA
> y5  0.5  0.6   0.1
> 
> __
> 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.


Re: [R] writing an equation with multiple summation

2015-09-28 Thread Jeff Newmiller
The brute force answer involves for loops or apply functions, with or without 
defining your own functions for calculating terms. More optimized methods 
usually require understanding the specific structure of the summations and 
unwinding them with functions like expand.grid. For more specific help, read 
the Posting Guide (which among other things warns you to post in plain text) 
and post a specific example of the type of problem that you want to solve.
---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On September 28, 2015 8:26:56 AM PDT, Maram SAlem  
wrote:
>Dear All,
>
>I'm trying to write and evaluate an equation which involves multiple
>summations but can't figure out how to do it.
>
>I've an numeric vector r
>r<-vector(mode = "numeric", length = m)
> and I have multiple summations (for ex.) of the form:
>
>[(sum from r[1]=0 to g(r[1])) (sum from r[2] =0 to g(r[2]))..(sum
>from
>r[m] to g(r[m]))] {the sum is over some complicated expression in
>r[1],r[2],.,r[m]},
>
>where g(r[i]) = m- (r[1] +r[2]+...+r[i-1])
>Any suggestions for some function or a package that can help me with
>this?
>
>Many Thanks,
>Maram
>
>   [[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.


Re: [R] R applications deployment models?

2015-09-28 Thread Jeff Newmiller
I am not necessarily referring to the business model (though many people asking 
this question are), but rather the install-to-bare-os deployment model that 
controls the user experience throughout. You typically need to install R as a 
separate product and use it interactively to kick your "application" into gear, 
should you choose to develop such.
---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On September 28, 2015 6:26:57 AM PDT, John McKown 
 wrote:
>On Mon, Sep 28, 2015 at 8:15 AM, Jeff Newmiller
>
>wrote:
>
>> R is not designed as an application development programming language.
>
>
>​This is an interesting statement to me. I don't really understand it.
>I
>have developed some applications in R. Do do you mean _commercial_
>applications (i.e. something paid for)?​ I think of R a bit like I
>think of
>SAS (which may be stupid of me). There are some commercial SAS
>applications
>(one that I know of is MXG for doing performance analysis and reporting
>on
>a specific OS - z/OS, which runs on IBM z series "mainframes").
>
>​​

__
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] How to get significance codes after Kruskal Wallis test

2015-09-28 Thread David L Carlson
The kruskalmc() function in package pgirmess performs a multiple comparisons 
analysis using the kruskal-wallis test. It indicates which pairs are 
significantly different, but it does not summarize the results in a compact 
letter display. 

> library(pgirmess)
> kruskalmc(Heliocide~Treatment, dta)
Multiple comparison test after Kruskal-Wallis 
p.value: 0.05 
Comparisons
obs.dif critical.dif difference
1_2d-1_7d  6.045455 19.11021  FALSE
1_2d-3_2d  3.83 18.69015  FALSE
1_2d-9_2d 21.50 19.60240   TRUE
1_2d-C17.045455 19.11021  FALSE
1_7d-3_2d  2.212121 19.11021  FALSE
1_7d-9_2d 15.454545 20.00331  FALSE
1_7d-C23.090909 19.52123   TRUE
3_2d-9_2d 17.67 19.60240  FALSE
3_2d-C20.878788 19.11021   TRUE
9_2d-C38.545455 20.00331   TRUE

-
David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77840-4352



-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius
Sent: Saturday, September 26, 2015 11:07 AM
To: Michael Eisenring
Cc: 'r-help'
Subject: Re: [R] How to get significance codes after Kruskal Wallis test


On Sep 26, 2015, at 6:48 AM, Michael Eisenring wrote:

> Thank you very much Kristina,
> 
> Unfortunately that's not what I am looking for.
> 
> I am just very surprised if there would be no possibility to get the 
> significance codes for Kruskal Wallis (I would have suggested that this is a 
> pretty common test.)

Well, it is modestly common test but its really a global test, and not a 
pairwise one.

> I found another option called kruskal() which does pairwise comparison, but 
> without significance codes.
> 
> Maybe another R-list member knows more.
> 

I'm not sure I "know more", and it's very possible I "know less". In particular 
I don't really know what the term "significance code" actually means. (I'm 
hoping it's not a request for "significance stars", a feature which is roundly 
deprecated by more knowledgeable R users.) 

However, looking at the agricolae::kruskal function's help page and submitting 
the data in the non-formulaic manner it expects, I get this output very similar 
in form the the HSD.test output that it appeared you considered satisfied 
satisfactory:

(an.dta3<-kruskal(dta$Heliocide, dta$Treatment))

#
$statistics
 Chisq  p.chisq
  30.25246 4.348055e-06

$parameters
  Df ntr  t.value
   4   5 2.007584

$means
 dta$Heliocide   std  rMin  Max
1_2d 1992.7707 1747.1879 12  334.53973 4929.372
1_7d 2368.8057 1187.9285 11  767.22881 4624.945
3_2d 2640.1286 2659.5800 12  615.91181 8559.142
9_2d 5338.6711 1579.4428 10 3328.89713 8014.897
C 397.9086  443.6019 11   75.73956 1588.431

$rankMeans
  dta$Treatment dta$Heliocide  r
1  1_2d 26.00 12
2  1_7d 32.045455 11
3  3_2d 29.83 12
4  9_2d 47.50 10
5 C  8.954545 11

$comparison
NULL

$groups
   trt means M
1 9_2d 47.50 a
2 1_7d 32.045455 b
3 3_2d 29.83 b
4 1_2d 26.00 b
5 C 8.954545 c

>From context I am guessing that the "significance codes" you ask for are the 
>items in the M column of the "groups" element of the list output.

-- 
David.

> 
> 
> Thank you,
> 
> Mike
> 
> 
> 
> Von: Kristina Wolf [mailto:kmw...@ucdavis.edu] 
> Gesendet: Freitag, 25. September 2015 23:26
> An: Michael Eisenring 
> Cc: r-help 
> Betreff: Re: [R] How to get significance codes after Kruskal Wallis test
> 
> 
> 
> Perhaps look into the function friedman.test.with.post.hoc()
> 
> There is more information here: 
> http://www.r-statistics.com/wp-content/uploads/2010/02/Friedman-Test-with-Post-Hoc.r.txt
> 
> 
> 
> Note, this does not handle NA's though, and technically it is for blocked 
> designs, but maybe it will lead you somewhere useful or could be adapted?
> 
> 
> ~ Kristina
> 
> Kristina Wolf
> Ph.D. Candidate, Graduate Group in Ecology
> M.S. Soil Science
> 
> 
> 
> On Fri, Sep 25, 2015 at 10:01 PM, Michael Eisenring   > wrote:
> 
> Is there a way to get significance codes after a pairwise comparisons to a
> Kruskall wallis test? With significance codes I mean letter codes (a, b,c)
> that are assigned to treatments to indicate where differences are
> significant.
> 
> With a traditional anova such a test can be performed using HSD.test from
> the agricolae library but for non parametric counterparts of anova I have
> not been able to find anything.
> 
> Can anyone help me?
> 
> Thanks mike
> 
> 
> 
> I added two example codes.
> 
> First code  represents an ANOVA and a HSD.test() giving me significant codes
> 
> #FIRST CODE USING ANOVA
> 
> library(agricolae)
> an.dta<-aov(Gossypol~Treatment,data=dta)
> summary(an.dta)
> 
> 

Re: [R] R applications deployment models?

2015-09-28 Thread John McKown
On Mon, Sep 28, 2015 at 9:19 AM, Jeff Newmiller 
wrote:

> I am not necessarily referring to the business model (though many people
> asking this question are), but rather the install-to-bare-os deployment
> model that controls the user experience throughout. You typically need to
> install R as a separate product and use it interactively to kick your
> "application" into gear, should you choose to develop such.
>

​Thanks. That helps me understand better. A difficult task on a Monday
morning after coming back from vacation! ​


-- 

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

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.

[R] writing an equation with multiple summation

2015-09-28 Thread Maram SAlem
Dear All,

I'm trying to write and evaluate an equation which involves multiple
summations but can't figure out how to do it.

I've an numeric vector r
r<-vector(mode = "numeric", length = m)
 and I have multiple summations (for ex.) of the form:

[(sum from r[1]=0 to g(r[1])) (sum from r[2] =0 to g(r[2]))..(sum from
r[m] to g(r[m]))] {the sum is over some complicated expression in
r[1],r[2],.,r[m]},

where g(r[i]) = m- (r[1] +r[2]+...+r[i-1])
Any suggestions for some function or a package that can help me with this?

Many Thanks,
Maram

[[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] Find Crossover Points of Two Spline Functions

2015-09-28 Thread Ben Bolker
Dario Strbenac  uni.sydney.edu.au> writes:

> 
> Good day,
> 
> I have two probability densities, each with a function determined
> by splinefun(densityResult[['x']],
> densityResult[['y']], "natural"), where densityResult is the
> output of the density function in stats.
> How can I determine all of the x values at which the densities cross ?
> 

  My initial thought was this is non-trivial, because the two densities could
cross (or nearly-but-not-quite cross) at an unlimited number of points.
I thought it would essentially boils down to "how do I find all 
the roots of an arbitrary (continuous, smooth) function?

  However, after thinking about it for a few more seconds I realize
that at least the functions are piecewise cubic.  I still don't see
a *convenient* way to do it ... if the knots were all coincident between
the two densities (maybe you could constrain them to be so?) then you
just have a difference of cubics within each segment, and you can use
polyroot() to find the roots (and throw out any that are complex or
don't fall within the segment).
  If the knots are not coincident it's more of a pain but you should
still be able to do it by considering overlapping segments ...

__
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] How to get significance codes after Kruskal Wallis test

2015-09-28 Thread David L Carlson
It may be, but the documentation for kruskal() seems to have fallen behind 
updates to the function. The kruskal() manual page indicates values returned by 
the function that have no connection to what is actually returned and M is not 
described at all. 

There is another version of the test, DunnTest() in the package DescTools. It 
appears to be less conservative than kruskalmc(). DunnTest() finds 6 
significant differences between the 10 pairs at .05 to the 4 identified by 
kruskalmc().

> library(DescTools)
> DunnTest(Heliocide~Treatment, dta)

 Dunn's test of multiple comparisons using rank sums : holm  

  mean.rank.diffpval
1_7d-1_2d   6.045455  0.5618
3_2d-1_2d   3.83  0.5648
9_2d-1_2d  21.50  0.0083 ** 
C-1_2d-17.045455  0.0342 *  
3_2d-1_7d  -2.212121  0.5648
9_2d-1_7d  15.454545  0.0602 .  
C-1_7d-23.090909  0.0040 ** 
9_2d-3_2d  17.67  0.0342 *  
C-3_2d-20.878788  0.0083 ** 
C-9_2d-38.545455 3.2e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

David C

From: Michael Eisenring [mailto:michael.eisenr...@gmx.ch] 
Sent: Monday, September 28, 2015 10:40 AM
To: David L Carlson
Cc: David Winsemius; 'r-help'
Subject: Aw: RE: [R] How to get significance codes after Kruskal Wallis test

Dear David,
Thanks for your answer.
Another member of the R list pointed out that one can actually use the function
kk<-kruskal(dta$Heliocide,dta$Treatment,group=TRUE,p.adj="bonferroni")
R gives then in the Results a section$groups
$groups
   trt     means M
1 9_2d 47.50 a
2 1_7d 32.045455 b
3 3_2d 29.83 b
4 1_2d 26.00 b
5 C     8.954545 c
 
I guess the codes under $groups in Column M are the significance codes I am 
looking for.
 
Thanks,
Mike
  
Gesendet: Montag, 28. September 2015 um 07:28 Uhr
Von: "David L Carlson" 
An: "David Winsemius" , "Michael Eisenring" 

Cc: 'r-help' 
Betreff: RE: [R] How to get significance codes after Kruskal Wallis test
The kruskalmc() function in package pgirmess performs a multiple comparisons 
analysis using the kruskal-wallis test. It indicates which pairs are 
significantly different, but it does not summarize the results in a compact 
letter display.

> library(pgirmess)
> kruskalmc(Heliocide~Treatment, dta)
Multiple comparison test after Kruskal-Wallis
p.value: 0.05
Comparisons
obs.dif critical.dif difference
1_2d-1_7d 6.045455 19.11021 FALSE
1_2d-3_2d 3.83 18.69015 FALSE
1_2d-9_2d 21.50 19.60240 TRUE
1_2d-C 17.045455 19.11021 FALSE
1_7d-3_2d 2.212121 19.11021 FALSE
1_7d-9_2d 15.454545 20.00331 FALSE
1_7d-C 23.090909 19.52123 TRUE
3_2d-9_2d 17.67 19.60240 FALSE
3_2d-C 20.878788 19.11021 TRUE
9_2d-C 38.545455 20.00331 TRUE

-
David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77840-4352



-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius
Sent: Saturday, September 26, 2015 11:07 AM
To: Michael Eisenring
Cc: 'r-help'
Subject: Re: [R] How to get significance codes after Kruskal Wallis test


On Sep 26, 2015, at 6:48 AM, Michael Eisenring wrote:

> Thank you very much Kristina,
>
> Unfortunately that's not what I am looking for.
>
> I am just very surprised if there would be no possibility to get the 
> significance codes for Kruskal Wallis (I would have suggested that this is a 
> pretty common test.)

Well, it is modestly common test but its really a global test, and not a 
pairwise one.

> I found another option called kruskal() which does pairwise comparison, but 
> without significance codes.
>
> Maybe another R-list member knows more.
>

I'm not sure I "know more", and it's very possible I "know less". In particular 
I don't really know what the term "significance code" actually means. (I'm 
hoping it's not a request for "significance stars", a feature which is roundly 
deprecated by more knowledgeable R users.)

However, looking at the agricolae::kruskal function's help page and submitting 
the data in the non-formulaic manner it expects, I get this output very similar 
in form the the HSD.test output that it appeared you considered satisfied 
satisfactory:

(an.dta3<-kruskal(dta$Heliocide, dta$Treatment))

#
$statistics
Chisq p.chisq
30.25246 4.348055e-06

$parameters
Df ntr t.value
4 5 2.007584

$means
dta$Heliocide std r Min Max
1_2d 1992.7707 1747.1879 12 334.53973 4929.372
1_7d 2368.8057 1187.9285 11 767.22881 4624.945
3_2d 2640.1286 2659.5800 12 615.91181 8559.142
9_2d 5338.6711 1579.4428 10 3328.89713 8014.897
C 397.9086 443.6019 11 75.73956 1588.431

$rankMeans
dta$Treatment dta$Heliocide r
1 1_2d 26.00 12
2 1_7d 32.045455 11
3 3_2d 29.83 12
4 9_2d 47.50 10
5 C 8.954545 11

$comparison
NULL

$groups
trt means M
1 9_2d 47.50 a
2 1_7d 32.045455 b
3 3_2d 29.83 b
4 1_2d 26.00 b

[R] Boxplot: Plot outliners in a different window

2015-09-28 Thread Tagmarie
Hi, 
I want to draw a usual boxplot. I have one outliner way up. It makes my
boxes being drawn tiny. I do not want to delete the outliner as it is also
of ecological importance. 
I know there is a way of drawing a second window on top of the boxplot which
starts at a different y-axis-scales and includes the outliners there. I saw
it on a poster once. I can't find the command though. Does anyone know it?
Best regards, 
Tagmarie



--
View this message in context: 
http://r.789695.n4.nabble.com/Boxplot-Plot-outliners-in-a-different-window-tp4712869.html
Sent from the R help mailing list archive at Nabble.com.

__
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-es] Error al agrupar datos por una variable en data.table

2015-09-28 Thread Olivier Nuñez
No estoy seguro de entender, pero prueba:

> require(data.table)
> DT=data.table(padres=c(1,1,1,2,2), indiviudos=1:5)
> DT
   padres indiviudos
1:  1  1
2:  1  2
3:  1  3
4:  2  4
5:  2  5
> DT[,.(count=.N),by=padres]
   padres count
1:  1 3
2:  2 2
> 


algunos_padres[,count := .N, by=padres]

- Mensaje original -
De: "Rodrigo López Correa" 
Para: "R-help-es" 
Enviados: Viernes, 25 de Septiembre 2015 15:48:39
Asunto: [R-es] Error al agrupar datos por una variable en data.table

Hola buenos días, estoy teniendo problemas cuando quiero agrupar los
registros de una tabla por una columna específica en data.table.



*Mi objetivo es agrupar todos los hijos que pertenecen a solo 2 padres
determinados.*



   - Por eso me traje todos sus hijos con subset desde una tabla.





algunos_padres<-data.table(subset(mydata, padres %in% c("0002480",
"0001878") ,

  select=(c(individuo,padres)),key="individuo"))




   - Para chequear que me haya traído solamente esos padres, busqué si
   tenía el padre “0001458”:



algunos_padres[padres=="0001458",]




   - El resultado fue el esperado, no estaba en la tabla algunos_padres:


Empty data.table (0 rows) of 7 cols #correct no era esperado




   - Sin embargo, acá viene mi problema, cuando le pido contabilizar el
   número de hijos obtenidos por  cada uno de esos 2 padres, el resultado
   trajo también animales que no deberían estar. Por ejemplo, el padre 0001458.



total_hijos<-algunos_padres[, as.data.table(table(padres))]

head (total_hijos)



padres N

1: 0001458 0

2: 0001512 0

3: 0001518 0

4: 0001519 0

….




   - Intenté hacerlo de otra manera y obtuve igual resultado:



   xtabs(~padres,data=algunos_padres)



   padres

   0001458 0001512 0001518 0001519 0001683 0001795 0001803
0001878

   0   00   0
 00   0   77 ….






   - En definitiva, intenté hacerlo de varias maneras y siempre con el
   mismo resultado, me trae en la estadística  padres que no formaron parte de
   mi subset inicial en algunos_padres, por más que después aparezcan con 0
   hijo en el resultado.






   - Por último probé:



algunos_padres[,count := uniqueN(individuo), by=padres]



pero aquí no me trajo como quiero en 2 lineas, el total de hijos de cada
uno de esos 2 padres. Quizás es redundante poner uniqueN, ya que el campo
individuo tiene registros únicos.







¿Me podrían ayudar? Muchas gracias!



Rodrigo.

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Singular Spectrum Analysis Plotting Skipping in a loop, but individually it works

2015-09-28 Thread Michael Dewey

Dear Dileep

What happens if you explicitly print it by wrapping the plot command in 
print(   )



On 28/09/2015 07:01, കുഞ്ഞായി kunjaai wrote:

Dear all,

I am trying to plot  Spectrum of Singular Values using "Rssa" package.

I am trying to plot singular spectrum plot  inside a loop, it is not
plotting, but when I am trying to plot individually in terminal it works,
and I can save this as png files.

My code is given below:

*# --Calculating and plotting  Spectrum of Singular Values of
Control-#*
library(ncdf)
library(Rssa)
season_list <-c('YEAR', 'DJF', 'JJA', 'SON', 'MAM')
zone_list <-c('ALLIN', 'WCIND', 'IPIND', 'ECIND', 'NEIND', 'NCIND',
'NWIND', 'WHIND')

for (sns in 1:length(season_list)){
for (rgn in 1:length(zone_list)){
var_noise<-paste(zone_list[rgn], "_",  season_list[sns], sep = "")
noise1<-get.var.ncdf(f_noise1, var_noise)
noise2<-get.var.ncdf(f_noise2, var_noise)
# Calculating Covariance Matrix from 'noise1' matrix
cv_noise_1 = noise1%*%t(noise1)
sigular_spectrum = ssa(cv_noise_1, svd.method = c("eigen"))

out_ssa_png =
paste("/home/dileep/WORK/Research_wind/CMIP_PiCOntrol_Expiriments/Homogenious_zone/homogenious_tempreture_zone/Homogenous_temp_Codes/Optimal_fingerprint_code/R/ECOF-package/SSA_noise_plots/SSA_",
zone_list[rgn], "_",  season_list[sns], "_SET_1.png", sep = "")

png(out_ssa_png, width= 6, height= 7.0, units = "in", res= 1200,
pointsize = 3)
print ("Created PNG file")
titl = paste(zone_list[rgn],  season_list[sns], sep = " ")
plot(sigular_spectrum , main=titl)
dev.off()
print ("Done !")
}
}
*####*

Thank you in advance



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
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] Singular Spectrum Analysis Plotting Skipping in a loop, but individually it works

2015-09-28 Thread കുഞ്ഞായി kunjaai
Dear all,

I am trying to plot  Spectrum of Singular Values using "Rssa" package.

I am trying to plot singular spectrum plot  inside a loop, it is not
plotting, but when I am trying to plot individually in terminal it works,
and I can save this as png files.

My code is given below:

*# --Calculating and plotting  Spectrum of Singular Values of
Control-#*
library(ncdf)
library(Rssa)
season_list <-c('YEAR', 'DJF', 'JJA', 'SON', 'MAM')
zone_list <-c('ALLIN', 'WCIND', 'IPIND', 'ECIND', 'NEIND', 'NCIND',
'NWIND', 'WHIND')

for (sns in 1:length(season_list)){
for (rgn in 1:length(zone_list)){
var_noise<-paste(zone_list[rgn], "_",  season_list[sns], sep = "")
noise1<-get.var.ncdf(f_noise1, var_noise)
noise2<-get.var.ncdf(f_noise2, var_noise)
# Calculating Covariance Matrix from 'noise1' matrix
cv_noise_1 = noise1%*%t(noise1)
sigular_spectrum = ssa(cv_noise_1, svd.method = c("eigen"))

out_ssa_png =
paste("/home/dileep/WORK/Research_wind/CMIP_PiCOntrol_Expiriments/Homogenious_zone/homogenious_tempreture_zone/Homogenous_temp_Codes/Optimal_fingerprint_code/R/ECOF-package/SSA_noise_plots/SSA_",
zone_list[rgn], "_",  season_list[sns], "_SET_1.png", sep = "")

png(out_ssa_png, width= 6, height= 7.0, units = "in", res= 1200,
pointsize = 3)
print ("Created PNG file")
titl = paste(zone_list[rgn],  season_list[sns], sep = " ")
plot(sigular_spectrum , main=titl)
dev.off()
print ("Done !")
}
}
*####*

Thank you in advance
-- 
DILEEPKUMAR. R
J R F, IIT DELHI

[[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] Find Crossover Points of Two Spline Functions

2015-09-28 Thread Dario Strbenac
Good day,

I have two probability densities, each with a function determined by 
splinefun(densityResult[['x']], densityResult[['y']], "natural"), where 
densityResult is the output of the density function in stats. How can I 
determine all of the x values at which the densities cross ?

--
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia

__
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] R applications deployment models?

2015-09-28 Thread Ali M.
I am new to R
And while learning the language inside the dev tools is easy and fun

I wonder how R applications are deployed and distributed to the typical
business users

I searched online of course and found some commercial options
The revolution r enterprise platform
Shiny r server from the makers of r-studio
There was also a video on youtube about a company wrapping their R
application in tcl/tk gui apps

But what else is available, what are the best practices ? is there free
alternatives to the commercial options i mentioned above?

Thanks
Ali

[[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] Appropriate specification of random effects structure for EEG/ERP data: including Channels or not?

2015-09-28 Thread Paolo Canal

Thank you Philllip,

And sorry being late in the response. Thanks for the reference, I 
believe that many of the published papers on ERPs with mixed models have 
descriptions of the analysis that often lacks of detail (even when 
looking for non *.linguistic journals).


Concerning your comments: I understand that nuisance factors are not 
random effects. At the same time the eeg amplitude is recorded from 
several electrodes which are units of observations around which the data 
are clustered. In the paper you suggested they write:


"In simplified models, by-channel random slope parameters were estimated 
at zero, resulting in failures to converge to an optimal solution. This 
likely reflects the limited variance in effects across the selected 
centro-parietal channels due to volume conduction. Therefore, random 
slopes of effects across channels were not fit in final models." This 
observation is not far from your point about adjacent electrodes being 
very highly correlated with each other, but I guess this would emerge in 
the random effects covariance matrix, only when asking for the 
calculation of by-channel random slopes or intercepts for some of the 
factors.


Therefore they used the term, only calculating adjustments to the 
intercepts, and I would have done the same just to increase fit, because 
I would say 1|ch better describes the data structure to lmer. But for 
pragmatism or necessity or parsimony, I'll likely forget about this (I 
am already trying to fit more than 80 parameters in the random structure 
so I do not want to be too strict about the inclusion of channels).


I keep your suggestion about modeling the topographic factors using the 
XYZ scalp-coordinates for the next studies when I'll have a better grasp 
on mixed models and some more computational power ;).


Thanks again for all your insights (I will refer to the special interest 
group in the next future).

best
Paolo


On 28/09/2015 04:17, Phillip Alday wrote:

You might also want to take a look at the recent paper from the Federmeier 
group, especially the supplementary materials. There are a few technical 
inaccuracies (ANOVA is a special case of hierarchical modelling, not the other 
way around), but they discuss some of the issues involved. And relevant for 
your work: they model channel as a grouping variable in the random-effects 
structure.

Payne, B. R., Lee, C.-L., and Federmeier, K. D. (2015). Revisiting the 
incremental effects of context on word processing: Evidence from single-word 
event-related brain potentials. Psychophysiology.

http://dx.doi.org/10./psyp.12515

Best,
Phillip


On 24 Sep 2015, at 22:42, Phillip Alday  wrote:

There is actually a fair amount of ERP literature using mixed-effects
modelling, though you may have to branch out from the traditional
psycholinguistics journals a bit (even just more "neurolinguistics" or
language studies published in "psychology" would get you more!). But
just in the traditional psycholinguistics journals, there is a wealth of
literature, see for example the 2008 special issue on mixed models of
the Journal of Memory and Language.

I would NOT encode the channels/ROIs/other topographic measures as
random effects (grouping variables). If you think about the traditional
ANOVA analysis of ERPs, you'll recall that ROI or some other topographic
measure (laterality, saggitality) are included in the main effects and
interactions. As a rule of thumb, this corresponds to a fixed effect in
random effects models. More specifically, you generally care about
whether the particular levels of the topographic measure (i.e. you care
if an ERP component is located left-anterior or what not) and this is
what fixed effects test. Random effects are more useful when you only
care about the variance introduced by a particular term but not the
specific levels (e.g. participants or items -- we don't care about a
particular participant, but we do care about how much variance there is
between participants, i.e. how the population of participants looks).

Or, another thought: You may have seen ANOVA by-subjects and by-items,
but I bet you've never seen an ANOVA by-channels. ANOVA "implicitly"
collapses the channels within ROIs and you can do the same with mixed
models. (That's an awkward statement technically, but it should help
with the intuition.)

There is an another, related important point -- "nuisance parameters"
aren't necessarily random effects. So even if you're not interested in
the per-electrode distribution of the ERP component, that doesn't mean
those should automatically be random effects. It *might* make sense to
add a channel (as in per-electrode) random effect, if you care to model
the variation within a given ROI (as you have done), but I haven't seen
that yet. It is somewhat rare to include a per-channel fixed effect,
just because you lose a lot of information that way and introduce more
parameters into the model, but you could include a 

Re: [R] Boxplot: Plot outliners in a different window

2015-09-28 Thread Jim Lemon
Hi Tagmarie,
Have a look at gap.boxplot (plotrix).

JIim


On Mon, Sep 28, 2015 at 4:50 PM, Tagmarie  wrote:

> Hi,
> I want to draw a usual boxplot. I have one outliner way up. It makes my
> boxes being drawn tiny. I do not want to delete the outliner as it is also
> of ecological importance.
> I know there is a way of drawing a second window on top of the boxplot
> which
> starts at a different y-axis-scales and includes the outliners there. I saw
> it on a poster once. I can't find the command though. Does anyone know it?
> Best regards,
> Tagmarie
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Boxplot-Plot-outliners-in-a-different-window-tp4712869.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.


Re: [R] Find Crossover Points of Two Spline Functions

2015-09-28 Thread Ben Bolker
Bert Gunter  gmail.com> writes:

> 
> Use ?uniroot to do it numerically instead of polyroot()?
> 
> Cheers,
> Bert
> Bert Gunter

  The problem with uniroot() is that we don't know how many intersections/
roots we might be looking for. With polyroot(), we know that there can
be at most 3 roots that lie within a particular cubic segment.

  (I'm not arguing that doing this is necessarily a good idea in
the larger context.)

__
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] merging tables based on both row and column names

2015-09-28 Thread C Lin
Dear R users,

I am trying to merge tables based on both their row names and column names.
My ultimate goal is to build a distribution table of values for each 
combination of row and column names. 
I have more test tables, more x's and y's than in the toy example below. 
Thanks in advance for your help.

For example :
test1 <- data.frame(rbind(c(0.1,0.2),0.3,0.1))
rownames(test1)=c('y1','y2','y3')
colnames(test1) = c('x1','x2');
test2 <- data.frame(rbind(c(0.8,0.9,0.5),c(0.5,0.1,0.6)))
rownames(test2) = c('y2','y5')
colnames(test2) = c('x1','x3','x2')

test1
   x1   x2
y1  0.1  0.2
y2  0.3  0.3
y3  0.1  0.1

test2
   x1   x3   x2
y2  0.8  0.9  0.5
y5  0.5  0.1  0.6

I would like to combine test1 and test2 such that if the column name and row 
name are both the same they are combined.

combined_test
   x1  x2 x3
y1  0.1  0.2   NA
y2  (0.3,0.8)(0.3,0.5)  0.9
y3  0.1  0.1   NA
y5  0.5  0.6   0.1

__
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] cumulative distribtuion function for multinomial distribution in R

2015-09-28 Thread li li
Hi all,
  In R, is there a function for the cumulative distribution function
for multinomial distribution? I only see pmultinom and rmultinom which
are the prabability mass function and the function for generating
multinomial random variables respectively.
  Thanks!
Hanna

__
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] [FORGED] cumulative distribtuion function for multinomial distribution in R

2015-09-28 Thread Rolf Turner

On 29/09/15 14:58, li li wrote:

Hi all,
   In R, is there a function for the cumulative distribution function
for multinomial distribution? I only see pmultinom and rmultinom which
are the prabability mass function and the function for generating
multinomial random variables respectively.


A moment's Googling would have led you to pmvnorm in package "mvtnorm".

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
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] plot changes usr?

2015-09-28 Thread Ed Siefker
I'm trying to plot() over an existing plot() like this:

> attach(mtcars)
> plot(mpg, hp)
> par(new=TRUE)
> par("usr")
[1]   9.46  34.84  40.68 346.32
> plot(mpg, hp, col="red", axes=FALSE, xlim=par("usr")[1:2], 
> ylim=par("usr")[3:4], xlab="", ylab="")
> par("usr")
[1]   8.4448  35.8552  28.4544 358.5456

For some reason "usr" is changing, and so it's not plotting over the
existing data in the right place.

__
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] FlexBayes installation from R-Forge Problem R 3.2.2

2015-09-28 Thread Pascal Oettli
You misspelled the web address. It is "R-project", not "R.project".
Thus, the command line should be:

install.packages("FlexBayes", repos="http://R-Forge.R-project.org;)

Regards,
Pascal

On Mon, Sep 28, 2015 at 9:17 AM, Davidwkatz  wrote:
> I tried to install FlexBayes like this:
>
> install.packages("FlexBayes", repos="http://R-Forge.R.project.org;) but got
> errors:
>
> Here's the transcript in R:
>
> R version 3.2.2 (2015-08-14) -- "Fire Safety"
> Copyright (C) 2015 The R Foundation for Statistical Computing
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
>   Natural language support but running in an English locale
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
>> install.packages("FlexBayes", repos="http://R-Forge.R.project.org;)
> Installing package into ‘C:/Users/dkatz/R/win-library/3.2’
> (as ‘lib’ is unspecified)
> Error: Line starting '
>
> Any help will be much appreciated!
>
> Thanks,
>
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/FlexBayes-installation-from-R-Forge-Problem-R-3-2-2-tp4712861.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] plot changes usr?

2015-09-28 Thread David Winsemius

On Sep 28, 2015, at 5:33 PM, Ed Siefker wrote:

> I'm trying to plot() over an existing plot() like this:
> 
>> attach(mtcars)
>> plot(mpg, hp)
>> par(new=TRUE)
>> par("usr")
> [1]   9.46  34.84  40.68 346.32
>> plot(mpg, hp, col="red", axes=FALSE, xlim=par("usr")[1:2], 
>> ylim=par("usr")[3:4], xlab="", ylab="")
>> par("usr")
> [1]   8.4448  35.8552  28.4544 358.5456

The default usr ranges are some factor (my hazy memory says 104%) of the range 
of thex- and y-values unless you specify otherwise. This choice allows round 
data-points to be displayed at the extremes. Why are you trying to muck with 
the plot setup? The right way would be to use points().


> 
> For some reason "usr" is changing, and so it's not plotting over the
> existing data in the right place.
> 
> __
> 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.

David Winsemius
Alameda, CA, USA

__
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 applications deployment models?

2015-09-28 Thread John McKown
On Mon, Sep 28, 2015 at 8:15 AM, Jeff Newmiller 
wrote:

> R is not designed as an application development programming language.


​This is an interesting statement to me. I don't really understand it. I
have developed some applications in R. Do do you mean _commercial_
applications (i.e. something paid for)?​ I think of R a bit like I think of
SAS (which may be stupid of me). There are some commercial SAS applications
(one that I know of is MXG for doing performance analysis and reporting on
a specific OS - z/OS, which runs on IBM z series "mainframes").

​​


-- 

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

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] R applications deployment models?

2015-09-28 Thread Jeff Newmiller
R is not designed as an application development programming language. Your 
question is a bit like asking why a car does not float like a boat. If you want 
to distribute analyses broadly then you are likely to either need to do it 
using a server or to expect users to become somewhat familiar with R.
Also, IANAL but don't forget that you will probably have obligations under the 
GPL if you modify R to fit it into a deployable application.
---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On September 28, 2015 1:23:43 AM PDT, "Ali M."  wrote:
>I am new to R
>And while learning the language inside the dev tools is easy and fun
>
>I wonder how R applications are deployed and distributed to the typical
>business users
>
>I searched online of course and found some commercial options
>The revolution r enterprise platform
>Shiny r server from the makers of r-studio
>There was also a video on youtube about a company wrapping their R
>application in tcl/tk gui apps
>
>But what else is available, what are the best practices ? is there free
>alternatives to the commercial options i mentioned above?
>
>Thanks
>Ali
>
>   [[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.


Re: [R] XPT files

2015-09-28 Thread Therneau, Terry M., Ph.D.
This was an FDA/SAS bargain a long while ago.  SAS made the XPT format publicly available 
and unchanging in return for it becoming a standard for submission.  Many packages can 
reliably read or write these files.  (The same is not true for other SAS file formats, nor 
is xport the SAS default.)  I do not know how good the R routines are, having never used them.


The following snippit is taken from
  
http://www.fda.gov/downloads/ForIndustry/DataStandards/StudyDataStandards/UCM312964.pdf

2 Dataset Specifications
2.1 File Format

SAS XPORT transport file format, also called Version 5 SAS transport format, is an open 
format published by the SAS Institute. The description of this SAS transport file format 
is in the public domain. Data can be translated to and from this SAS transport format to 
other commonly usedformats without the use of programs from SAS Institute or any specific 
vendor.


Sponsors can find the record layout for SAS XPORT transport files through SAS technical 
support technical document TS-140. This document and additional information about the SAS 
Transport file layout can be found on the SAS World Wide Web page at 
http://www.sas.com/fda-esub.


---
Said document TS-140  talks about IBM 360 and Dec VAX machines but no others, which should 
give you an idea of its age.


Terry Therneau


On 09/27/2015 05:00 AM, r-help-requ...@r-project.org wrote:

Peter

Thanks for the explanation.  One further comment ? you wrote:

>I don't think the FDA "requests" XPT files

In fact, they do make such a request.  Here is the actual language received 
this week (and repeatedly in the past):

>Program/script files should be submitted using text files (*.TXT) and the data 
should be submitted using SAS transport files (*.XPT).

Dennis


__
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 applications deployment models?

2015-09-28 Thread Duncan Murdoch

On 28/09/2015 4:23 AM, Ali M. wrote:

I am new to R
And while learning the language inside the dev tools is easy and fun

I wonder how R applications are deployed and distributed to the typical
business users


Typically as web applications, rather than standalone executables.



I searched online of course and found some commercial options
The revolution r enterprise platform
Shiny r server from the makers of r-studio
There was also a video on youtube about a company wrapping their R
application in tcl/tk gui apps

But what else is available, what are the best practices ? is there free
alternatives to the commercial options i mentioned above?


Shiny is free.  You can pay them to run the server hosting your 
application and give you access to support, but you don't need to do 
that if you don't mind running it yourself and asking the community for 
help.  I'm not familiar with the others.


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.