[R] Matrixplot (VIM package): can I add a colour scale?

2013-04-02 Thread Ross Marriott
Dear R Help, I would like to know how to add a colour scale to a matrixplot please. Here is the code that I've used to construct the matrix plot: library(VIM) SpatialPlot <- function(YearxBlock,plot.title){ # Years are columns, Blocks are rows in this matrix YearxBlock <- as.matrix(YearxBlock) #

Re: [R] Generating a bivariate joint t distribution in R

2013-04-02 Thread Jorge I Velez
Dear Miao, Check require(MASS) ?mvrnorm for some ideas. HTH, Jorge.- On Wed, Apr 3, 2013 at 4:57 PM, jpm miao <> wrote: > Hi, > >I conduct a panel data estimation and obtain estimators for two of the > coefficients beta1 and beta2. R tells me the mean and covariance of the > distribution

[R] Generating a bivariate joint t distribution in R

2013-04-02 Thread jpm miao
Hi, I conduct a panel data estimation and obtain estimators for two of the coefficients beta1 and beta2. R tells me the mean and covariance of the distribution of (beta1, beta2). Now I would like to find the distribution of the quotient beta1/beta2, and one way to do it is to simulate via the j

Re: [R] Iterative regression through a series

2013-04-02 Thread Mark Leeds
Hi: rollapply is a fine solution but if you frame your problem as a state space model where the observation equation is the linear regression you're interested in, the state space framework provided by the DLM package will give you the output you want at each step t. the gory details are explained

Re: [R] kernlab::kkmeans initial centers

2013-04-02 Thread Pascal Oettli
Hi, I would say that if you know what k-means algorithm is, you know the meaning of "initial cluster centers". You can also check the output of the provided example. Regards, Pascal On 04/03/2013 09:27 AM, Ahmed Elgohary wrote: Hi, I am trying to pass initial cluster assignments to the kkm

Re: [R] Iterative regression through a series

2013-04-02 Thread David Chertudi
Thank you, Michael--it looks like a fantastic package.  I'm fairly new to R, and not at all familiar with the zoo class, but it seems to have great potential.  I'll need to spend some time sorting out how to use regressions in it, because the syntax used in the examples is alien to me.   Mendi

[R] kernlab::kkmeans initial centers

2013-04-02 Thread Ahmed Elgohary
Hi, I am trying to pass initial cluster assignments to the kkmeans methodof kernlab. It is not clear to me how I can set the parameter *centers* with "initial cluster centers" as stated in the documentation? thanks, --ahmed

Re: [R] ctree (party) - select a specific variable in the first split

2013-04-02 Thread Salvatore Loguercio
Hi Achim, Thank you for the quick suggestion. I actually did the first split manually, then grew two trees in the two subsets, it worked. Best, Sal Hello, My question is related to ctree() function from the library 'party'. See fortune(58). Yeah, package 'party' - sorry for the confusion

[R] creating a loop if to create a column of 0 and 1.

2013-04-02 Thread Marco A . Pérez
Hi, I am new with rstudio and i have a trouble with this program. I store 17 listsCPOD<-list()CPOD[[1]]<- GB1ACPOD[[2]]<- GB1CCPOD[[3]]<- GB1DCPOD[[4]]<- GB2ACPOD[[5]]<- GB2BCPOD[[6]]<- GB2CCPOD[[7]]<- GB2DCPOD[[8]]<- GB3ACPOD[[9]]<- GB3CCPOD[[10]]<- GB3DCPOD[[11]]<- GB4ACPOD[[12]]<- GB4CCPOD[[

[R] sqlSave writes, but only for sqlFetch

2013-04-02 Thread Dave Mitchell
I've been having some issues with sqlSave, and I think I've found an clue that may identify the problem. In the code at http://pastebin.com/0USzNFfq, I connect to a Netezza instance, make a simple table, and query it. Despite sqlSave succeeding without error, sqlQuery tells me the table doesn't ex

[R] sqlSave writes, but only for sqlFetch

2013-04-02 Thread Dave Mitchell
I've been having some issues with sqlSave, and I think I've found an clue that may identify the problem. In the code at http://pastebin.com/vTAKt4bL, I connect to a Netezza instance, make a simple table, and query it. Despite sqlSave succeeding without error, sqlQuery

Re: [R] Iterative regression through a series

2013-04-02 Thread triskell4-umbre...@yahoo.fr
That is very helpful--I've run your code, and it works perfectly with the example data.  However, I'm having some problems using my actual data--probably because my Time variable isn't actually a regular series (as it was in the example: Time=1:100).  When run, it's producing "estim" and "error"

[R] sqlFetch works but sqlQuery doesn't

2013-04-02 Thread Dave Mitchell
I've been having some issues with sqlSave, and I think I've found an clue that may identify the problem. In the code at http://pastebin.com/W6UGKep9, I connect to a Netezza instance, make a simple table, and query it. Despite sqlSave succeeding without error, sqlQuery tells me that the table doesn

Re: [R] plot

2013-04-02 Thread Greg Snow
On Mon, Apr 1, 2013 at 10:26 AM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > > > Yes -- in fact that's the way you're "supposed" to do it and the > RStudio way you mentioned above is a shortcut. > And the longest distance between any 2 points is a shortcut. -- Gregory (Greg) L. Sno

Re: [R] Iterative regression through a series

2013-04-02 Thread Michael Weylandt
Also look at zoo's rollapply. MW On Apr 2, 2013, at 13:51, Rui Barradas wrote: > Hello, > > The error comes from NAs where you would expect coefficients. Try the > following. > > > > set.seed(7511) # Make the example reproducible > > N <- 100 > Time <-1:N > Price <- rnorm(N, 8, 2) > >

Re: [R] Iterative regression through a series

2013-04-02 Thread Rui Barradas
Hello, The error comes from NAs where you would expect coefficients. Try the following. set.seed(7511) # Make the example reproducible N <- 100 Time <-1:N Price <- rnorm(N, 8, 2) estim <- numeric(N) # It's better to allocate the results error <- numeric(N) # vectors in advance for (i

Re: [R] How to do platform independent system calls?

2013-04-02 Thread annoporci
I'm new to R and learning so I probably don't have much of value to share, but I do use Windows and kUbuntu interchangeably and need to share code across these two platforms, so let me tell you what I've found -- it may or may not help you. Most of the R packages can be used on any platform. So

Re: [R] exporting tables to word

2013-04-02 Thread Carlos Valenzuela
You may also want to consider the "rtf" package. It works okay. You would have to save your results as a dataframe and you would be able to write that object out to an .rtf (or even use an .doc extension, as I have seen it done). For example, library(rtf) # Your regression formula lmobj<-lm(dv~

Re: [R] R 14.0, ggplot2: could not find function "initRefFields"

2013-04-02 Thread Frans Marcelissen
I agree that what I said was one sided. I know that the spss GPL and ggplot2 are based on the same grammar. I have the impression that ggplot2 is much easier to use. But I must agree that I stopped trying to understand gpl after discovering ggplot2. Frans 2013/4/2 J. R. M. Hosking > On 2013-04-

[R] Iterative regression through a series

2013-04-02 Thread triskell4-umbre...@yahoo.fr
Hello, Some context:  let's say I have a data series (let's call it PRICE, for simplicity), sample size N.  I have a desire to regress that on TIME, and then to use the TIME and intercept coefficients to predict the price in the next period and to use the standard error to calculate a confiden

[R] [R-pkgs] softImpute_1.0 uploaded to CRAN

2013-04-02 Thread Trevor Hastie
SoftImpute is a new package for matrix completion - i.e. for imputing missing values in matrices. SoftImpute was written by myself and Rahul Mazumder. softImpute uses uses squared-error loss with nuclear norm regularization - one can think of it as the "lasso" for matrix approximation - to find

Re: [R] exporting tables to word

2013-04-02 Thread Gabor Grothendieck
On Tue, Apr 2, 2013 at 1:50 PM, Alexander Shenkin wrote: > Thanks Carlos, > > ftable has some internal routines, it seems, that allow it to print out > a flat contigency table in a nice format. Converting to data.frame ends > up messing up the display format, unfortunately. > > thanks, > allie >

Re: [R] exporting tables to word

2013-04-02 Thread Alexander Shenkin
Thanks Carlos, ftable has some internal routines, it seems, that allow it to print out a flat contigency table in a nice format. Converting to data.frame ends up messing up the display format, unfortunately. thanks, allie On 4/2/2013 12:41 PM, Carlos Valenzuela wrote: > You may also want to co

Re: [R] How to do platform independent system calls?

2013-04-02 Thread S Ellison
> > 2) Is there a way to generate platform independent paths? So that > > "path/2/input.tbl" on *nix systems becomes "path\2\input.tbl" on a > > Windows system? > > R already does that automatically. Clarification. R does that automatically _for paths used by R_ (including, on my system, the

Re: [R] exporting tables to word

2013-04-02 Thread Alexander Shenkin
Thanks Frans, odfTable seems not to like ftable objects. any thoughts? Error: chunk 1 (label = damageTable) Error in UseMethod("odfTable") : no applicable method for 'odfTable' applied to an object of class "ftable" thanks, allie On 4/2/2013 8:09 AM, Frans Marcelissen wrote: > Hi Allie,

Re: [R] Create a vector without using an external 'if statement'

2013-04-02 Thread Adams, Jean
Stefano, My guess is that you don't need an if() statement at all. But it's hard to answer your question without knowing what sort of operations you want to do. I suggest giving a more complete example. Also, you should always cc R-help on your correspondence, so that other readers can follow the

Re: [R] Help on dendrogram reorder

2013-04-02 Thread Adams, Jean
You can define the weights like this ... order.i.want <- c(3, 6, 7, 4, 5, 2, 8, 9, 1, 10) wts <- order(order.i.want) dd.reorder <- reorder(dd, wts, mean) plot(dd.reorder, main="ordered random dendrogram") You should cc R-help on all communication ... that way other readers can follow the thread,

Re: [R] What is SAS options missing=0 equivalent in R?

2013-04-02 Thread peter dalgaard
On Apr 2, 2013, at 16:49 , ramoss wrote: > I have a dataframe & wish to convert the NA (missing values) to zero . In SAS > I would use options missing=0 to convert all my obs in a dataset. How can I > accomplish the same thing in R? Can it be done? Thanks for any thoughts on > this. > The str

Re: [R] R Commander and FactoMineR

2013-04-02 Thread John Fox
Dear Dániel, One normally sends a bug report to the maintainer of a package, in this case the maintainer of the FactoMineR package, Francois Husson, to whom I'm copying this reply. Best, John John Fox Sen. William McMaster Prof. of Social Stati

Re: [R] What is SAS options missing=0 equivalent in R?

2013-04-02 Thread Ista Zahn
google "r replace NA with 0" (without the quotes). On Tue, Apr 2, 2013 at 10:49 AM, ramoss wrote: > I have a dataframe & wish to convert the NA (missing values) to zero . In SAS > I would use options missing=0 to convert all my obs in a dataset. How can I > accomplish the same thing in R? Can it

Re: [R] Plotting histogram of RT data

2013-04-02 Thread John Kane
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example What is x=readdir supposed to do? John Kane Kingston ON Canada > -Original Message- > From: circle@gmail.com > Sent: Sun, 31 Mar 2013 22:12:57 +1100 > To: r-help@r-project.org > Subject: [R] Plot

[R] Question about removing missing data rows in the qplot

2013-04-02 Thread Wang, Zhensheng
Hi, I've a question about the qplot. I use facets=Antibiotics~Gram.Stainng to draw 6 plots in a panel. Now the problem is within each 'Gram.Staining' categorical level there are some antibiotics does not have value (in my case is log(MIU)). Because some antibiotics are positive gram staining

Re: [R] gdata selectively not working

2013-04-02 Thread Robin Jeffries
T hank you Paul, that was the problem. I have installed R into Dropbox and so am aware of access issues, I have to pause syncing whenever I install a new package. I assumed that would work here as well. Unfortunately even when DB sync is paused (or turned off) I still can't read the file into Gdat

Re: [R] speedometer charts in R

2013-04-02 Thread R. Michael Weylandt
Look at the R GoogleVis package. MW On Tue, Apr 2, 2013 at 9:42 AM, andrija djurovic wrote: > Hi useRs. > > Does anybody know if there is some function that creates speedometer chart > in R? Or if anybody has proposals where to start looking and which > functions I can modify in order to create

[R] coxph and variables

2013-04-02 Thread sylvain
Dear list,I am quite new to the world of biostatistics and I encounter some issues in the precise understanding of the coxph function of the survival package.I have a set of survival data (patient who had (or died from) a breast cancer) I'd like to see which are the variables that might cause dead

[R] new window cairo bundle Re: [Rd] R/Sweave/cairo/freetype bug fix.

2013-04-02 Thread Hin-Tak Leung
--- On Mon, 1/4/13, Hin-Tak Leung wrote: > --- On Sat, 30/3/13, Hin-Tak Leung > > wrote: > > > "... was committed to freetype in January and will form > the > > next release (2.4.12)". > > It is perhaps worth repeating the quote:  'The official > R binaries for windows ... are compiled against

Re: [R] R 14.0, ggplot2: could not find function "initRefFields"

2013-04-02 Thread J. R. M. Hosking
On 2013-04-02 04:28, Frans Marcelissen wrote: Hi, I have a problem combining R and SPSS (21). I do not know whether the solution is in R or in spss, so I will post both in the R group and in the SPSS group. I use the R plugin in spss(21). The most important reason to use this plugin is ggplot2 (

[R] What is SAS options missing=0 equivalent in R?

2013-04-02 Thread ramoss
I have a dataframe & wish to convert the NA (missing values) to zero . In SAS I would use options missing=0 to convert all my obs in a dataset. How can I accomplish the same thing in R? Can it be done? Thanks for any thoughts on this. -- View this message in context: http://r.789695.n4.nabble

[R] speedometer charts in R

2013-04-02 Thread andrija djurovic
Hi useRs. Does anybody know if there is some function that creates speedometer chart in R? Or if anybody has proposals where to start looking and which functions I can modify in order to create this kind of chart? Thanks for any help Andrija [[alternative HTML version deleted]] _

Re: [R] Is DUD available in nls()?

2013-04-02 Thread Hans W Borchers
Bert Gunter gene.com> writes: > > I certainly second all Jeff's comments. > > **HOWEVER** : > http://www.tandfonline.com/doi/pdf/10.1080/00401706.1978.10489610 > > IIRC, DUD's provenance is old, being originally a BMDP feature. > Thanks for the pointer. That seems to be an interesting derivat

[R] R doesn't recognize utils functions, such as arrayIndex( )

2013-04-02 Thread Yi Yuan
Hi all, When I called arrayIndex(20:23, dim=c(4,3,3)), it says "Error: could not find function "arrayIndex"in R". So I called ls("package:utils") to see the functions inside: [1] "?" [2] "adist" [3] "alarm" [4] "apropos" [5] "aregexec" [6] "argsAnywhere" [7] "arrangeWindows" [8] "a

Re: [R] exporting tables to word

2013-04-02 Thread Frans Marcelissen
Hi Allie, My preferred method is by means of odfWeave. Odfweave generates a libreoffice file, which can directly be transferred to word. A second way is run R from within spss. Spss has a much better output than R, but you can use the output system of spss (by means of spsspivottable.Display()) Fra

[R] exporting tables to word

2013-04-02 Thread Alexander Shenkin
Hello all, What is your preferred method to export tables (from ftable()) to Word? Do you just export to a text file and then copy/paste? Or perhaps via HTML output? Thanks, Allie __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

Re: [R] Array analogue of row and col

2013-04-02 Thread Enrico Bibbona
Great! Thanks a lot, Enrico 2013/4/2 Duncan Murdoch > On 02/04/2013 6:36 AM, Enrico Bibbona wrote: > >> Is there any function that extends to multidimentional arrays the >> functionalities of "row" and "col" which are just defined for matrices? >> Thanks, Enrico Bibbona >> > > Not as far as I k

[R] reverse sweep operator

2013-04-02 Thread Berg, Tobias van den
Dear R-users, For obtaining a weighted correlation matrix with (some) missing data I use the sweep operator (swp function in the ggm-package) to find the maximum likelihood estimates of the standardized slopes and error variances. In the end I would like to use a reverse sweep operator but unfo

Re: [R] Is DUD available in nls()?

2013-04-02 Thread Prof J C Nash (U30A)
One of the reasons DUD is not available much any more is that methods have evolved: - nls (and nlxb() from nlmrt as well as nlsLM from minpack.LM -- which are more robust but may be less efficient) can use automatic derivative computation, which avoids the motive for which DUD was written -

[R] lognormal sampleing using covariance matrix

2013-04-02 Thread Keith S Weintraub
Andras, I am no expert but you could start with correlated normal random variables and then convert to lognormal. You can use rmvsnorm from the {fCopulae} package to generate the correlated normals. Here is a call that I have used in the past: set.seed(12345) numSims<-10 # number of mult

Re: [R] R doesn't recognize utils functions, such as arrayIndex( )

2013-04-02 Thread Yi Yuan
Hi, Sarah, Thank you! I knew I was missing something obvious, but I couldn't figure it out. I actually first typed install.packages(R.utils) and forgot the quotations, so I got an error message:Error in install.packages : object 'R.utils' not found. I didn't know it was because of the quotation m

[R] plm: Hausman Test error

2013-04-02 Thread Millo Giovanni
Hello. Here are my comments: your email would make for such a nice bug report, if only you would add: - a reproducible example of the fail in phtest() - a reproducible example of your code, if it's yours, and also the source of the code, if on the contrary you found it somewhere; because as it is,

Re: [R] Create a vector without using an external 'if statement'

2013-04-02 Thread Adams, Jean
Stefano, How are you reading your data into R? If you are using a function like read.table(), you may be able to inform R upon reading the data that -999 represents a missing value using an option like na.strings, for example: read.table(file, na.strings="-999") Otherwise, you can change th

Re: [R] R doesn't recognize utils functions, such as arrayIndex( )

2013-04-02 Thread Sarah Goslee
Why do you think the utils package and the R.utils package are the same thing? Sarah On Tuesday, April 2, 2013, Yi Yuan wrote: > Hi all, > > When I called arrayIndex(20:23, dim=c(4,3,3)), it says "Error: could not > find function "arrayIndex"in R". So I called ls("package:utils") to see the > fu

[R] Create a vector without using an external 'if statement'

2013-04-02 Thread Stefano Sofia
Dear R-users, suppose I have three dataframes like these df1: mydate min_temp 31032013 12 01042013 8 02042013 -999 df2: mydate min_temp 31032013 10 01042013 11 02042013 14 df3: mydate min_temp 31032013 4 01042013 3 02042013 5 where -999 means that the temperature data is not available (at th

Re: [R] read.delim

2013-04-02 Thread Steve Friedman
You have to tell R what the column delimiter is. See Read.table. On Apr 2, 2013 8:28 AM, "Shane Carey" wrote: > Hi, > > Im reading in a .txt file into R that consists of 5 columns, however, when > imported into R, it reads all the data into just one column. Is there a way > of telling R to creat

Re: [R] Array analogue of row and col

2013-04-02 Thread Duncan Murdoch
On 02/04/2013 6:36 AM, Enrico Bibbona wrote: Is there any function that extends to multidimentional arrays the functionalities of "row" and "col" which are just defined for matrices? Thanks, Enrico Bibbona Not as far as I know, but there are a lot of functions in packages. You could write your

[R] read.delim

2013-04-02 Thread Shane Carey
Hi, Im reading in a .txt file into R that consists of 5 columns, however, when imported into R, it reads all the data into just one column. Is there a way of telling R to create a dataframe with 5 columns rather than putting all the data into one column? Thanks -- Shane [[alternative H

Re: [R] DUD (Does not Use Derivatives) for nonlinear regression in R?

2013-04-02 Thread Paul Johnson
On Apr 1, 2013 1:10 AM, "qi A" wrote: > > Hi, All > > SAS has DUD (Does not Use Derivatives)/Secant Method for nonlinear > regression, does R offer this option for nonlinear regression? > > I have read the helpfile for nls() and could not find such option, any > suggestion? > nelder-mead is defau

Re: [R] How to do platform independent system calls?

2013-04-02 Thread S Ellison
> -Original Message- > 1) Is there a way to implement such calls to external tools, > so they become platform independent? I mean, so that these > calls will work both on a *nix and a Windows system? No - at least, not generally, for the more or less obvious reason that *nix tools are

Re: [R] changing y-axis intervals in a boxplot

2013-04-02 Thread S Ellison
> -Original Message- > I'm a bit of a rooky in R and do not know how to change the > y-axis intervals of a boxplot. > ... > I used the following code for producing this boxplot: > boxplot((fitted(finalfit4) *100) ~ > instabilitydata2$MRI_Diag_Instab_rev, ylim=c(0,100), > xlab="MRA di

Re: [R] How to do platform independent system calls?

2013-04-02 Thread Gerrit Eichner
Hello, Anis, can't say anything about your 1st question, but w.r.t. the 2nd ?file.path should do what you want. Regards -- Gerrit On Tue, 2 Apr 2013, Asis Hallab wrote: Dear R experts, I hope everyone has had a happy easter break. Recently my work included writing R function that need

[R] Array analogue of row and col

2013-04-02 Thread Enrico Bibbona
Is there any function that extends to multidimentional arrays the functionalities of "row" and "col" which are just defined for matrices? Thanks, Enrico Bibbona [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://st

Re: [R] R Commander and FactoMineR

2013-04-02 Thread Dániel Kehl
Hello, well yes, I see that it should be ... ,invisible=c("none"), new.plot=TRUE) or something similar. I can correct this "by hand" The point was more like a bug-report. Maybe not the best place to mention a bug, but I couldn't find a better one. I do not know how to change the output of the

[R] How to do platform independent system calls?

2013-04-02 Thread Asis Hallab
Dear R experts, I hope everyone has had a happy easter break. Recently my work included writing R function that need to call external tools. I did this using R's system function for example: system( paste( 'tool', '-input', path_to_input, '-output', path_to_output, '-other_switch', some_val ) )

Re: [R] R Commander and FactoMineR

2013-04-02 Thread Pascal Oettli
Hello, Did you check the position of the brackets, for example for "invisible" argument? Regards, Pascal On 04/02/2013 06:09 PM, Dániel Kehl wrote: Dear Users, I helped to install R Commander and FactoMineR to one of my collegaues. He wanted to do an MCA. Selecting three variables and usin

[R] R Commander and FactoMineR

2013-04-02 Thread Dániel Kehl
Dear Users, I helped to install R Commander and FactoMineR to one of my collegaues. He wanted to do an MCA. Selecting three variables and using the default settings results in only one graph, the variables representation, where he gets three points for the three variables (which is totally fine)

[R] R 14.0, ggplot2: could not find function "initRefFields"

2013-04-02 Thread Frans Marcelissen
Hi, I have a problem combining R and SPSS (21). I do not know whether the solution is in R or in spss, so I will post both in the R group and in the SPSS group. I use the R plugin in spss(21). The most important reason to use this plugin is ggplot2 (spss does not have a decent graphical system). T

[R] Rpy2 and Mac OS X 10.8.3

2013-04-02 Thread Craig Watson
I am having a strange problem. I have been using python + rpy2 on my Mac for quite sometime now. I recently upgraded to OS X 10.8 from 10.6 and that's when the problem began. Now, when I try to load some R packages (like zoo) using robjects.r, python crashes with seg fault 11. Here's an example be

Re: [R] Is DUD available in nls()?

2013-04-02 Thread Ben Bolker
Bert Gunter gene.com> writes: > > I certainly second all Jeff's comments. > > **HOWEVER** : > http://www.tandfonline.com/doi/pdf/10.1080/00401706.1978.10489610 > > IIRC, DUD's provenance is old, being originally a BMDP feature. > If you want to do derivative-free nonlinear least-squares fi

Re: [R] ctree (party) - select a specific variable in the first split

2013-04-02 Thread Achim Zeileis
On Mon, 1 Apr 2013, Salvatore Loguercio wrote: Hello, My question is related to ctree() function from the library 'party'. See fortune(58). Is there a way to force ctree() to use a specific variable in the first split? No way that does this automatically. I am asking because the first sp