Re: [R] Issues with fa() function in "psych"

2014-05-15 Thread sagnik chakravarty
Hi William, Thanks for the update. I see this package has so many capabilities ! I will suggest further for its development if anything else comes to my mind. Regards, Sagnik On Thu, May 15, 2014 at 6:34 AM, William Revelle wrote: > Sagnik, > > I did some more checking and in fact you can do

Re: [R] Miss lines in LaTex code generated by function xtable in R

2014-05-15 Thread Duncan Mackay
Hi If print gives you trouble try cat("\\end{document}\n\n") Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun..

Re: [R] Retrieving the matched data frame from Matching?

2014-05-15 Thread Bert Gunter
Don't know anything about this in particular, but ?str, as in str(m8) is often useful in such situations. But hopefully you'll get a better, more specific answer. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge.

[R] Retrieving the matched data frame from Matching?

2014-05-15 Thread Art Burke
I'm trying to use the Matching package to create a matched dataset but I'm having trouble retrieving the data frame where the comparison cases are identified. Could someone please give me a pointer on how to do this? The call was a simple one and seems to have worked with no errors ... m8 <- Ma

Re: [R] Character type and size using spatstats

2014-05-15 Thread Rolf Turner
Dear Patrick, OK. I think I have figured out what you are trying to do. You want: * each "type" of point (where type is the corresponding level of "Concept") to be represented by a different symbol, * the size of the symbol to be determined by the value of "New". The "maxsize" ar

Re: [R] Markoc chain simulation of a sample path - to get empirical probabilities

2014-05-15 Thread Rolf Turner
(1) This list is *NOT* for helping people with homework. (2) Your code is kludgy, inefficient, and apparently wrong. (3) Think about what is going to happen in your very first call to sample() --- it will be: sample(6,1,prob=P[path[5],]) (Note that "replace=TRUE" is unnecessary and nons

Re: [R] How to make a Latex table using R

2014-05-15 Thread ravenween
stargazer is the best. http://cran.r-project.org/web/packages/stargazer/stargazer.pdf heres an example code: stargazer(women_con_mod, women_con_mod, se = list(WCM_naive.std.err,WCM_rob.std.err), title="Regress

Re: [R] Miss lines in LaTex code generated by function xtable in R

2014-05-15 Thread Jeff Newmiller
Why not use knitr to build the document that the output of xtable is to be a part of? --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] Miss lines in LaTex code generated by function xtable in R

2014-05-15 Thread David Winsemius
On May 15, 2014, at 1:30 PM, Liao, Hongsheng wrote: > data(tli) > ## Demonstrate data.frame > tli.table <- xtable(tli[1:10,]) > digits(tli.table)[c(2,6)] <- 0 > print(tli.table,floating=FALSE) > > I used above R code to generate Latex code as below. However, Tex Live can't > run the code after

Re: [R] stop a function

2014-05-15 Thread Henrik Bengtsson
Two quick comments: 1. You do not need to reset the timeout limits yourself; it's already taken care of, cf. help("evalWithTimeout"). 2. Have you tried example(evalWithTimeout)? It should illustrate how it works/is used. It's also a good example to verify that it also works on your machine (I'd

[R] Miss lines in LaTex code generated by function xtable in R

2014-05-15 Thread Liao, Hongsheng
data(tli) ## Demonstrate data.frame tli.table <- xtable(tli[1:10,]) digits(tli.table)[c(2,6)] <- 0 print(tli.table,floating=FALSE) I used above R code to generate Latex code as below. However, Tex Live can't run the code after I code and paste it to Tex Live. The reasons are: at the very b

[R] question about wfct in minpack.lm package

2014-05-15 Thread Andras Farkas
Dear All,   made some headways with my nls model, thanks for the help... I would like to ask if you could provide some insights to the following:   I am trying to use wfct() from minpack.lm so that I could do the weighting using one of the predictors, but getting an error message:   library(minp

Re: [R] Pb

2014-05-15 Thread Prof Brian Ripley
On 15/05/2014 11:19, ilias.khatt...@bbox.fr wrote: Hi, I'm an engineer student who work on a project with hadoop & R. I installed the ODBC driver and configure it and it works with excel but I earn some problems with R. I think it's maybe because of my OS which is a Mavericks

[R] Chicago, Data Mining Training (Hands-On, $35), Chicago, May 23rd

2014-05-15 Thread Lisa Solomon
Join us for a hands-on data mining training in Chicago, IL on May 23, 2014: * Cost: $35 * Registration: http://hub.am/1ftOoR0 * Learn data mining quickly using Salford Systems' Commercial Data Mining Software (No programming skills needed). Agenda: 8:30am-9:00am Breakf

[R] Ctrl + r failure

2014-05-15 Thread Zaiyaolin
Hello, I just start to use windows 8.1 and I suddenly can't use ctrl + r to execute commands in R. This never happens when I used XP before. Dose anyone know how to deal with this situation? Thx. Yao Sent from my iPhone __ R-help@r-project.org maili

[R] Pb

2014-05-15 Thread ilias . khattari
Hi, I'm an engineer student who work on a project with hadoop & R. I installed the ODBC driver and configure it and it works with excel but I earn some problems with R. I think it's maybe because of my OS which is a Mavericks. I saw there are no binaries files for my OS in the RO

[R] How to Optimize two functions together in R

2014-05-15 Thread Mingxuan Han
I am trying to minimize two functions with same set of parameter(x,y). Currently I can only use optim() to minimize the each function one by one. Is there any solution I can use to optimize two functions with same set of (X,Y) together. -- View this message in context: http://r.789695.n4.nab

[R] Markoc chain simulation of a sample path - to get empirical probabilities

2014-05-15 Thread chantel7777777
The question: A computer store sells iPods. If at the end of the day they have 0 or 1 unit of stock, they order enough new units so that their total number of units on hand is 5. New merchandise arrives before the store opens the next day. Demand each day is random with the following distribution

[R] survival estimates for covariate values

2014-05-15 Thread array chip
Hi all, let's say we can fit a Cox model with a numeric variable "x" as the independent variable. The we can calculate, say 10-year survival, for any given value of "x" (0 to 10 in increment of 0.1 in the example below): > fit <- coxph(Surv(time, event)~x,dat) > surv10yr<- summary(survfit(fit,n

Re: [R] ggplot barplot error

2014-05-15 Thread Vikram Bahure
Thanks a lot. This is really helpful. On Thu, May 15, 2014 at 8:12 PM, Dennis Murphy wrote: > Hi: > > There are several options, but you shot yourself in the foot by using > cbind() to combine objects of different classes into a matrix, so > everything ends up being a factor because a matrix is

Re: [R] Bootstrapping the prediction intervals for regression

2014-05-15 Thread Rui Barradas
Hello, The jackknife is used as a bias reduction technique, and since linear regression estimates are unbiased I don't see why you should use it. Rui Barradas Em 15-05-2014 19:21, varin sacha escreveu: Thanks Bert for your suggestion that is working. To answer to your question, I can say th

Re: [R] Bootstrapping the prediction intervals for regression

2014-05-15 Thread varin sacha
Thanks Bert for your suggestion that is working. To answer to your question, I can say that some econometricians say that using bootstrap techniques on a linear regression model when the sample size N is small, one of the most interesting purpose is on the prediction intervals which is better f

Re: [R] find an empty char in the name of a vector

2014-05-15 Thread arun
Hi, Hi, If the names vector is similar to below: v2 <- c("g_", "", " ","g2","    ", "g3") grep("^$| +",v2) #[1] 2 3 5 #or  grep("^\\s*$",v2) #[1] 2 3 5 A.K. On Thursday, May 15, 2014 6:36 AM, arun wrote: Hi, Assuming that this is the case: v2 <- c("g_", "", "g2","g3")  which(v2=="") #[1

Re: [R] Help install sann package for Simulated Annealing

2014-05-15 Thread Prof Brian Ripley
Please do not repeat post: this is https://stat.ethz.ch/pipermail/r-help/2014-May/374643.html . There is no such package on CRAN, probably your default repository. (And R package names are case sensitive: neither sann not SANN exist there.) You will need to specify where to find it if indeed

[R] Help install sann package for Simulated Annealing

2014-05-15 Thread nourhan iyte
Dear all, I try to install the package SANN but unfortunatly received this warning Warning in install.packages : package ‘sann’ is not available (for R version 3.0.3) do yo know how can i solve this? or if you know another helping package with example to be used for simulated annealing

Re: [R] Manipulating dataframes

2014-05-15 Thread arun
Hi, May be this helps: dat <- read.table(text="ID    YEAR_MONTH    ATT_1    ATT_2 1    201301   Y  1 1    201302   Y  1 1    201302   N  0 1    201302   Y  0 1    201303   N 

Re: [R] Bayesian Network

2014-05-15 Thread Bert Gunter
Wrong list. This is about R programming. Post on a statistics list like stats.stackexchange.com for statistical discussions. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom.

[R] Bayesian Network

2014-05-15 Thread Alexsandro Cândido de Oliveira Silva
Hello everybody! I have worked with Bayesian Network in R. Currently, the algorithm interacts with the user to define the model graphic. But now I would like automate it. Today I found out the BNLEARN package that implements some algorithms (gs, iamb, fast.iamb, hc, mmhc...) for learning the stru

Re: [R] How to make a Latex table using R

2014-05-15 Thread Duncan Murdoch
On 15/05/2014 9:46 AM, Liao, Hongsheng wrote: http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf I am trying to learn how to make a Latex table using R from the link above. However, instead of a Latex table as showed in the link, the R codes from the link generate actua

Re: [R] ggplot barplot error

2014-05-15 Thread Dennis Murphy
Hi: There are several options, but you shot yourself in the foot by using cbind() to combine objects of different classes into a matrix, so everything ends up being a factor because a matrix is an atomic object with a dim attribute, and atomic objects must have a common class, so Flows and Categor

Re: [R] How to make a Latex table using R

2014-05-15 Thread Luca Cerone
Hi Liao, I think that the purpose of the package is actually to create the latex code to insert into Latex documents. If you want to see it displayed you have to compile it with latex; the document you have sent says that that is a gallery to show the different kind of tables you can create. 2014

[R] How to make a Latex table using R

2014-05-15 Thread Liao, Hongsheng
http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf I am trying to learn how to make a Latex table using R from the link above. However, instead of a Latex table as showed in the link, the R codes from the link generate actual Latex codes as follows: % latex table generat

Re: [R] lognormal frailey

2014-05-15 Thread Therneau, Terry M., Ph.D.
For log-normal you can use the coxme package instead. On 05/15/2014 05:00 AM, r-help-requ...@r-project.org wrote: Hi everyone I am attempting to estimate a model with a frailty effect distributed as a lognormal variable.I am using the following code: frailtyPenal(formula, data, ..., RandDist =

Re: [R] Bootstrapping the prediction intervals for regression

2014-05-15 Thread Bert Gunter
Please note that this can (and should) be considerably sped up by taking advantage of the fact that lm() will work on a matrix of responses. Also, some improvement in speed can usually be obtained by generating all samples at once rather than generating the sample each time within a loop. somethin

Re: [R] find an empty char in the name of a vector

2014-05-15 Thread Uwe Ligges
On 15.05.2014 12:12, carol white wrote: Hi, I have a vector with the name of an element that is empty. How can I find out the index of this element? The following doesn't work: empty.char = grep('[:blank:||:space:]' ,names(v)) if (length(empty.char)>0) grep("^[[:space:]]*$", c(x,

[R] Manipulating dataframes

2014-05-15 Thread Abhinaba Roy
Hi R-helpers, I have a dataframe as shown below IDYEAR_MONTHATT_1ATT_2 1201301 Y 1 1201302 Y 1 1201302 N 0 1201302 Y 0 1201303 N 1

Re: [R] needs help in augented plot

2014-05-15 Thread Frede Aakmann Tøgersen
Dear Salam So you apparently did not read the posting guide as you were supposed to when joining this list Every email from the list has this footer: > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE

Re: [R] Bootstrapping the prediction intervals for regression

2014-05-15 Thread varin sacha
Hi Rui, Many thanks for your response. I have tried to adapt your code to my problem, but there is still a mistake LinearModel.1 <- lm(GDP.per.head ~ Competitivness.score + Quality.score,   data=Dataset) B <- 500  # number of bootstrap samples result <- array(dim = c(22, 3, B)) for(i in 1:B) {

Re: [R] Why are integers coded as e.g. "2L" in R functions?

2014-05-15 Thread Alexander Engelhardt
So in essence, it always provides the same output, but saves space and speed. Thanks everyone! - Alex On 05/15/2014 01:06 PM, Prof Brian Ripley wrote: On 15/05/2014 11:54, Alexander Engelhardt wrote: Hello R-help, I keep noticing R functions that don't compare integers like if(x == 2) bu

Re: [R] ggplot barplot error

2014-05-15 Thread arun
Hi, Please post in plain text. (lots of "*") May be this helps: Date <- c("2014-04-01","2014-04-02","2014-04-03","2014-04-04","2014-04-07", "2014-04-09","2014-04-10","2014-04-01","2014-04-02","2014-04-03", "2014-04-04","2014-04-07","2014-04-09","2014-04-10") Flows <- c(479.6,187.2,  148.6,   41.

[R] ggplot barplot error

2014-05-15 Thread Vikram Bahure
Hi, I am facing issue with ggplot plotting. I have given the data and the code below. I have also attached the graph below. Problem: On date "*2014-04-07*", we have debt and equity flow, but it does not shows equity flow. Ideally what I would like is the stack for debt/equity starts from X axis.

Re: [R] for loop using index values

2014-05-15 Thread arun
Hi, Not sure I understand correctly.  May be this helps: ##If the blocks are created as a list set.seed(475)  lst1 <- setNames(lapply(1:10, function(i) {rowN <- sample(20,1)*15; matrix(sample(40,10*rowN, replace=TRUE), nrow=rowN)}),1:10) sapply(lst1,nrow)>100  #   1 2 3 4 5

[R] needs help in augented plot

2014-05-15 Thread Mir Salam
Dear all, I have problem in augmented plot to reduce the text (font ) size in heading of each plot. I have 68 plots and in augmented plot, I have heading of 68 plots in a panel. The headline of each plot coded with plot characteristic, but the text seems to be big. How I will reduce the text s

Re: [R] Why are integers coded as e.g. "2L" in R functions?

2014-05-15 Thread Prof Brian Ripley
On 15/05/2014 11:54, Alexander Engelhardt wrote: Hello R-help, I keep noticing R functions that don't compare integers like if(x == 2) but instead if(x == 2L) Is this a long integer? Also, when do the two notations have a different effect on the code? 2L is an integer. both in the mathe

Re: [R] Why are integers coded as e.g. "2L" in R functions?

2014-05-15 Thread Pascal Oettli
Hello, Probably you will get more complete answer, but you can compare "class(1)" with "class(1L)". Regards, Pascal On Thu, May 15, 2014 at 7:54 PM, Alexander Engelhardt wrote: > Hello R-help, > > I keep noticing R functions that don't compare integers like > if(x == 2) > but instead > if(x

Re: [R] Why are integers coded as e.g. "2L" in R functions?

2014-05-15 Thread arun
Hi Alex, May be this link helps: http://stackoverflow.com/questions/7014387/whats-the-difference-between-1l-and-1 A.K. On Thursday, May 15, 2014 6:55 AM, Alexander Engelhardt wrote: Hello R-help, I keep noticing R functions that don't compare integers like   if(x == 2) but instead   if(x

Re: [R] Why are integers coded as e.g. "2L" in R functions?

2014-05-15 Thread Rui Barradas
Hello, 2 is a double, 2L is an integer. Try > class(2) [1] "numeric" > class(2L) [1] "integer" Hope this helps, Rui Barradas Em 15-05-2014 11:54, Alexander Engelhardt escreveu: Hello R-help, I keep noticing R functions that don't compare integers like if(x == 2) but instead if(x == 2

Re: [R] Bootstrapping the prediction intervals for regression

2014-05-15 Thread Rui Barradas
Hello, Try to follow the example below and see if you can adapt it to your needs. Since you don't provide us with a dataset example, I start by making up some. # make up some data n <- 22 set.seed(8873) dat <- data.frame(x1 = rnorm(n), x2 = rnorm(n)) dat$y <- x1 + x2 + rnorm(n) B <- 100 #

Re: [R] slow with indexing with is.na

2014-05-15 Thread arun
Hi, If you can convert the data.frame to matrix, there would be some improvement. For e.g. fun1 <- function(data){ data[is.na(data)] <- 0 data} fun2 <- function(data){ mat <- as.matrix(data) mat[is.na(mat)] <-0 mat} fun3 <- function(data){ mat <- as.matrix(data) indx <- which(is.na(mat), arr

[R] Why are integers coded as e.g. "2L" in R functions?

2014-05-15 Thread Alexander Engelhardt
Hello R-help, I keep noticing R functions that don't compare integers like if(x == 2) but instead if(x == 2L) Is this a long integer? Also, when do the two notations have a different effect on the code? Thanks in advance, Alex __ R-help@r-proj

Re: [R] nested design

2014-05-15 Thread S Ellison
> I would like to apply a nested ANOVA on my dataset, but I cannot find a > satisfying answer on how to implement it in R. The simplest formula for a two-level nested design is resp~fac1/fac2 All of the models you list are equivalent to this after allowing for the fact that R drops duplicated mo

Re: [R] find an empty char in the name of a vector

2014-05-15 Thread arun
Hi, Assuming that this is the case: v2 <- c("g_", "", "g2","g3")  which(v2=="") #[1] 2 ##Second question v1 <- c("g_", "g_w1", "g_w2", "g_bc3") grepl("\\bg_\\b",v1) #[1]  TRUE FALSE FALSE FALSE v1[grepl("\\bg_\\b",v1)] #[1] "g_" A.K. Hi, I have a vector with the name of an element that is e

Re: [R] bin a vector of continuous variables

2014-05-15 Thread Kehl Dániel
Hi, you might try writing your own function, something like roundDown <- function(x) floor(x/100)*100 > roundDown(c(2282,174,273,432)) [1] 2200 100 200 400 and than apply it to your column. Please use ?dput next time to present your data, and post in plain text, instead of HTML. best, dan

[R] find an empty char in the name of a vector

2014-05-15 Thread carol white
Hi, I have a vector with the name of an element that is empty. How can I find out the index of this element? The following doesn't work: empty.char = grep('[:blank:||:space:]' ,names(v)) if (length(empty.char)>0)     How about if the name of one element is g_ and the name of other elements

Re: [R] bin a vector of continuous variables

2014-05-15 Thread arun
Hi, check ?cut or ?findInterval dat <- read.table(text="partner1 partner2 Substract 1_5000_5001_1    1    5001  2282.3435 1_5000_10001_15000    1    10001  174.1275 1_5000_15001_2    1    15001  273.822 1_5000_20001_25000    1    20001  546.27 1_5000_25001_

[R] dist like function but where you can configure the method

2014-05-15 Thread Witold E Wolski
Looking for an fast dist implementation where I could pass my own dist function to the "method" parameter i.e. mydistfun = function(x,y){ return(ks.test(x,y)$p.value) #some mystique implementation } wow = dist(data,method=mydistfun) thanks -- Witold Eryk Wolski __

[R] bin a vector of continuous variables

2014-05-15 Thread Assa Yeroslaviz
Hi all, I have a data.frame of three columns: partner1 partner2 Substract 1_5000_5001_1 1 5001 2282.3435 1_5000_10001_15000110001 174.1275 1_5000_15001_2115001 273.822 1_5000_20001_25000120001 546.27

Re: [R] Piecewise Aggregate Approximation in r

2014-05-15 Thread Pascal Oettli
Hello, library(sos) findFn("Piecewise Aggregate Approximation") or RSiteSearch('Piecewise Aggregate Approximation') Hope this helps, Pascal On Thu, May 15, 2014 at 6:13 PM, Babak Bastan wrote: > Hi experts > > Is there any package or function in r to use PAA (Piecewise Aggregate > Approximati

[R] Bootstrapping the prediction intervals for regression

2014-05-15 Thread varin sacha
Dear experts, > > >I have done a multiple linear regression on a small sample size (n=22). >I have computed the prediction intervals (not the confidence intervals). > > >Now I am trying to bootstrap the prediction intervals. > > >I didn't find any package doing that. >So I decide to create my own R

[R] Piecewise Aggregate Approximation in r

2014-05-15 Thread Babak Bastan
Hi experts Is there any package or function in r to use PAA (Piecewise Aggregate Approximation). Could you please inform me if is there any? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] Character type and size using spatstats

2014-05-15 Thread Rolf Turner
On 15/05/14 19:27, Patrick Connolly wrote: On Thu, 15-May-2014 at 03:00PM +1200, Rolf Turner wrote: |> |> Dear Patrick, |> |> (a) Your attachment did not come through; only attachments with |> extensions belonging to a limited class are passed through by the |> list software. I should have made

Re: [R] how to make R plot under Linux

2014-05-15 Thread Patrick Connolly
On Thu, 15-May-2014 at 09:37AM +0800, 友文 wrote: |> In our server, R is already installed. But the X11 is DISABLE. |> The operational system of server is Ubuntu. It is only a command |> line system without graph interface. |> Do you know how to Enable X11 in R on the Ubuntu server? |> I have

Re: [R] Character type and size using spatstats

2014-05-15 Thread Patrick Connolly
On Thu, 15-May-2014 at 03:00PM +1200, Rolf Turner wrote: |> |> Dear Patrick, |> |> (a) Your attachment did not come through; only attachments with |> extensions belonging to a limited class are passed through by the |> list software. I should have made use of dput() twice instead. However, it

[R] Counting number of days my program runs

2014-05-15 Thread Ashis Deb
Hi all , I have a package and i want to count the 1st execution day of the package till 30 days afterwards ? I hope I am clear with this question . Please reply if you have anything to share . Thanks ASHIS [[alternative HTML version deleted]]