[R] Multiple plot in a page

2016-08-02 Thread roslinazairimah zakaria
Dear r-users, I would like to plot 4 graphs arranged as 2 by 2 and follows are my codes. However, it only shows one graph. par(mfrow=c(1,2)) par(mar=c(4,4,2,1.2),oma=c(0,0,0,0),xaxs="i", yaxs="i") ## To control white space around and between the plots hist(stn_all[,1],prob=TRUE, main ="Balok ",

Re: [R] Anderson Darling Goodness of fit test

2016-08-02 Thread roslinazairimah zakaria
Hi Marc, I will try again. Thank you. On Wed, Aug 3, 2016 at 1:02 AM, Marc Schwartz wrote: > > > On Aug 2, 2016, at 11:37 AM, roslinazairimah zakaria < > roslina...@gmail.com> wrote: > > > > Dear r-users, > > > > I would like to perform Anderson Darling Goodness of fit test as such: > > > > ins

Re: [R] Anderson Darling Goodness of fit test

2016-08-02 Thread roslinazairimah zakaria
Hi david, I will try again. Thank you.. On Wed, Aug 3, 2016 at 1:01 AM, David L Carlson wrote: > I think you did not include the other error messages you got while running > your code. Package adk was removed from CRAN a while ago: > > > install.packages("adk") > Warning message: > package 'adk

Re: [R] plot many dfs in ggplot

2016-08-02 Thread lily li
Another question is, if I want to shade the range between the maximum and minimum values for daily or annual values, how to do it? Thanks again. On Tue, Aug 2, 2016 at 12:50 PM, lily li wrote: > Hi all, > > I have another question. There are several dataframes, each has the same > columns: time

Re: [R] generate a vector of random numbers within confines of certain parameters

2016-08-02 Thread Bert Gunter
All floating point operations are done to machine precision -- roughly 16 digits. See ?.Machine . You can choose to round, truncate, or display to anything less than that that you care to. See also the digits parameter of ?options The rest of your post is ambiguous to me. But note that (all?/most

Re: [R] generate a vector of random numbers within confines of certain parameters

2016-08-02 Thread Jeff Newmiller
x <- rnorm( 2, 5, 2.5 ) The requirement for "random" is ill-specified because it omits mention of which random distribution you want (I assumed normal distribution above). The requirement for "decimal places" is ill-defined because floating point numbers are internally represented with mant

[R] Three way correspondence analyses?

2016-08-02 Thread Suparna Mitra
Hello R experts, have some data for microbiome, metabolome and cytokine from the same sample. Now I want to do a three-way correspondence analyses. From three normalised data I was trying, #Now CCA with two data it works good like: Metab.Cytok.Microb.cca <- cca(normMicrobiome_NEC,normCytok_and_

Re: [R] generate a vector of random numbers within confines of certain parameters

2016-08-02 Thread David L Carlson
The second one (x2) uses the same mean/sd for the 2 variates. If you want to change the mean/sd for each variate: > x3 <- round(replicate(2, rnorm(1, runif(1, 4, 6), runif(1, 2, 3))), 6) > head(x3) [1] 5.648530 5.689563 2.945512 3.915723 8.527447 0.298535 --- David C -Original M

Re: [R] generate a vector of random numbers within confines of certain parameters

2016-08-02 Thread David L Carlson
Try > set.seed(42) > x1 <- round(rnorm(2, 4, 2), 6) > head(x1) [1] 6.741917 2.870604 4.726257 5.265725 4.808537 3.787751 Setting the seed makes the sequence reproducible, but if that is not important, you can leave it out. This assumes you want a normal distribution and you want to specify

[R] generate a vector of random numbers within confines of certain parameters

2016-08-02 Thread Adrian Johnson
Dear group, I am trying to generate a vector of random numbers for 20K observation. however, I want to generate numbers (with 6 decimal places) within the range of Std. Dev : 2-3 mean : 4-6 Is there a method to generate numbers with 6 decimal places under these parameters thank you. Adrian __

[R] plot many dfs in ggplot

2016-08-02 Thread lily li
Hi all, I have another question. There are several dataframes, each has the same columns: time, varA, varB, varC, etc. If I want to plot time ~ varA of each dataframe, where different dataframe names use different colors. How to do this in ggplot? Thanks for your help. Right now, I tried to use t

[R] how to plot annual values directly

2016-08-02 Thread lily li
Hi R users, I have a dataframe, with daily precipitation data, is it possible to plot annual mean or annual sum values directly? Thanks for your help. df year month day precip time 2010 1 10.5 2010-01-01 2010 1 20.8 2010-01-02 2010

Re: [R] What is "args" in this function?

2016-08-02 Thread Jeff Newmiller
Unfortunately for you, this email list is about R (not C), and while the Posting Guide indicates that questions discussing how to interface with C belong in R-devel, that is not a forum for learning C. On the plus side, the data types and macros you are asking questions about are highly specif

Re: [R] Anderson Darling Goodness of fit test

2016-08-02 Thread Marc Schwartz
> On Aug 2, 2016, at 11:37 AM, roslinazairimah zakaria > wrote: > > Dear r-users, > > I would like to perform Anderson Darling Goodness of fit test as such: > > install.packages("adk") > library(adk) > x3 <- list(stn_all[,1], balok_gen); x3 > adk.test(x3) > > #x3 <- list(jun_data1_pos,jun_ge

Re: [R] Anderson Darling Goodness of fit test

2016-08-02 Thread David L Carlson
I think you did not include the other error messages you got while running your code. Package adk was removed from CRAN a while ago: > install.packages("adk") Warning message: package 'adk' is not available (for R version 3.3.1) > library(adk) Error in library(adk) : there is no package called 'a

Re: [R] Regression expression to delete one or more spaces at end of string

2016-08-02 Thread David R Forrest
Double the [[]] and add a + for one-or-more characters: sub("[[:blank:]]+$", "", COLNAMES) > On Aug 2, 2016, at 12:46 PM, Dennis Fisher wrote: > > R 3.3.1 > OS X > > Colleagues, > > I have encountered an unexpected regex problem > > I have read an Excel file into R using the readxl packa

Re: [R] Regression expression to delete one or more spaces at end of string

2016-08-02 Thread William Dunlap via R-help
First, use [[:blank:]] instead of [:blank:]. that latter matches colon, b, l, a, n, and k, the former whitespace. Second, put + after [[:blank:]] to match one or more of them. Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Aug 2, 2016 at 9:46 AM, Dennis Fisher wrote: > R 3.3.1 > OS X > >

Re: [R] Regression expression to delete one or more spaces at end of string

2016-08-02 Thread Marc Schwartz
> On Aug 2, 2016, at 11:46 AM, Dennis Fisher wrote: > > R 3.3.1 > OS X > > Colleagues, > > I have encountered an unexpected regex problem > > I have read an Excel file into R using the readxl package. Columns names are: > > COLNAMES <- c("Study ID", "Test and Biological Matrix", "Subj

Re: [R] Fuzzy_partition with fuzzy_trapezoid

2016-08-02 Thread Arthur Stilben
Thanks, Sarah, for response. But you showed me an example with fuzzy_variable. I'd like to use fuzzy_partition. I also tried: > teste = fuzzy_partition(varnames = c('a', 'b'), FUN = fuzzy_trapezoid, > corners = c(1,2,3,4), height = c(1,1) ) But the trapezoids 'a' and 'b' were overlap. Is there a

[R] Regression expression to delete one or more spaces at end of string

2016-08-02 Thread Dennis Fisher
R 3.3.1 OS X Colleagues, I have encountered an unexpected regex problem I have read an Excel file into R using the readxl package. Columns names are: COLNAMES<- c("Study ID", "Test and Biological Matrix", "Subject No. ", "Collection Date", "Collection Time", "Scheduled Time Point",

[R] Anderson Darling Goodness of fit test

2016-08-02 Thread roslinazairimah zakaria
Dear r-users, I would like to perform Anderson Darling Goodness of fit test as such: install.packages("adk") library(adk) x3 <- list(stn_all[,1], balok_gen); x3 adk.test(x3) #x3 <- list(jun_data1_pos,jun_gen); x3 #adk.test(x3) However, I got this reply: > adk.test(x3) Error: could not find fun

[R] What is "args" in this function?

2016-08-02 Thread Justin Thong
Hi again I need help *R-code* debug(model.matrix) model.matrix(~S) *model.matrix code* ans <- .External2(C_modelmatrix, t, data) #t =terms(object) , data="data frame of object" *modelframe C-code* SEXP modelframe(SEXP call, SEXP op, SEXP args, SEXP rho) { SEXP terms, data, names, variables,

Re: [R] Fuzzy_partition with fuzzy_trapezoid

2016-08-02 Thread Sarah Goslee
As already discussed, yes, but you can't specify corners and height twice in a single call. Please do read the help for the functions you're interested in, and perhaps go back to refresh yourself on some basic R. > sets_options("universe", seq(from = 0, to = 10, by = 0.1)) > test1 = fuzzy_variable

Re: [R] questions about co-linearity in logistic regression from Stefano Sofia

2016-08-02 Thread Greg Snow
Stefano, It is usually best to keep these discussions on R-help. People there may be quicker to respond and could have better answers. Keeping the discussion on the list also means that if others in the future find your question, they will also find the answers and discussion. And some of us can

[R] Fuzzy_partition with fuzzy_trapezoid

2016-08-02 Thread Arthur Stilben
I already made this question, but I was not subscribed and not received any reply. I tried this: > install.packages("sets") ... > library(sets) > teste = fuzzy_partition(varnames = c('a', 'b'), FUN = fuzzy_trapezoid, > corners = c(1,2,3,4), height = c(1,1), corners = c(5,6,7,8), height = c(1,1) )

Re: [R] Fuzzy variable universe

2016-08-02 Thread Arthur Stilben
Thanks, Sarah, for the reply. It really works. 2016-07-28 15:50 GMT-03:00 Sarah Goslee : > On Thu, Jul 28, 2016 at 2:46 PM, Arthur Rodrigues Stilben > wrote: >> >> >> Em 28-07-2016 15:45, Arthur Rodrigues Stilben escreveu: >>> >>> Sarah, >>> >>> First of all, thanks for reply. >>> >>> Second, It

Re: [R] Colour gradients in ggtern

2016-08-02 Thread Ulrik Stervbo
Hi Jake, maybe you can just revet the colours given to the scale: scale_colour_gradientn(colours = rev(rainbow(5.5))) Best, Ulrik On Tue, 2 Aug 2016 at 16:41 Jake William Andrae wrote: > Hello, > > This is my first time posting to the r-help mailing list and I'm a > relative amateur using R,

Re: [R] Fwd: Help: malloc/free deadlock in unsafe signal handler 'Rf_onsigusr1'

2016-08-02 Thread Ming Li
Thanks luke. cc hawq dev team. I sent this email to R-devel 2 days before forwarding it to R-help, but no one reply. Is there any workaround? When were SIGUSR1 and SIGUSR2 sent in R? Or maybe we should move all operations not too emergency out of signal handler? Thanks. On Tue, Aug 2, 2016 at

[R] Colour gradients in ggtern

2016-08-02 Thread Jake William Andrae
Hello, This is my first time posting to the r-help mailing list and I'm a relative amateur using R, so forgive my naivety. I am constructing a ternary diagram using the ggtern extension of the ggplot package, and I'm having some trouble with the colour gradient I want it to display. I have atta

Re: [R] Read output:

2016-08-02 Thread roslinazairimah zakaria
Dear all, All of you are right. I use the external hard drive and yesterday my laptop screen went blackout. So I guess that is the cause. Thank you for your help. On Tue, Aug 2, 2016 at 9:53 PM, Jeff Newmiller wrote: > R could not find the specified file. Either it is not there or file system

Re: [R] Read output:

2016-08-02 Thread Jeff Newmiller
R could not find the specified file. Either it is not there or file system permissions (off topic here) prevented access to the file. -- Sent from my phone. Please excuse my brevity. On August 1, 2016 11:30:42 PM PDT, roslinazairimah zakaria wrote: >Dear r-usersl, > >I don't understand this c

[R] Antwort: Re: Re: Spread data.frame on 2 variables (SOLVED)

2016-08-02 Thread G . Maubach
Hi Ulrik, many thanks for your help. The problem was that R regards a dataset with a combination like caseID custID channel unit 1 100010 10 2 100020 10 3 100020

Re: [R] Read output:

2016-08-02 Thread Duncan Murdoch
On 02/08/2016 2:30 AM, roslinazairimah zakaria wrote: Dear r-usersl, I don't understand this comment: gambang <- read.csv("G:/A_backup 11 mei 2015/DATA (D)/1 Universiti Malaysia Pahang/ISM-3 2016 UM/Data/Hourly Rainfall/gambang2.csv",header=TRUE) Error in file(file, "rt") : cannot open the co

Re: [R] DEA -- Extract the Frontier and ggplot2

2016-08-02 Thread Roman Luštrik
Hi, this is not really a ggplot2 issue, but here goes. If you look at the source code of the Benchmarking package (here ) you will notice that the function is not very explicit about what to return - so the returned thing is actually

Re: [R] DEA -- Extract the Frontier and ggplot2

2016-08-02 Thread Lorenzo Isella
Hello, Thanks for your suggestion, but it is does not help me much. Indeed, in this case where RTS="vrs", things are easy as you say. However, try for instance to change the technology assumption (e.g. replace it with RTS="drs" everywhere in my script) and you'll see that things are not that simpl

Re: [R] about netcdf files

2016-08-02 Thread Marc Girondot via R-help
You can find many tutorials in internet. For example, I did one here: http://max2.ese.u-psud.fr/epc/conservation/Girondot/Publications/Blog_r/Entrees/2014/4/27_Comparison_between_packages_RnetCDF%2C_ncdf4_and_ncdf.html Without any reproducibl example, it is impossible to help you further. Sincere

[R] DEA -- Extract the Frontier and ggplot2

2016-08-02 Thread Lorenzo Isella
Dear All, Please consider the code at the end of the email. Everything is fine in this little example, just I do not know how to extract the DEA frontier (solid line in the plot). The reason is that I want to reproduce a more complicated DEA frontier plot using ggplot2 and I need to understand how

Re: [R] Read output:

2016-08-02 Thread Jim Lemon
Hi Roslina, As we do not know whether the file actually exists, all I can do is to suggest that you look in your file manager (Windows Explorer, probably) and see if the file is where you think it is. The problem is most likely a spelling error somewhere in the path or filename. Jim On Tue, Aug