Re: [R] print(cenfit object) to a data.frame

2014-04-10 Thread Massimo Bressan
thanks rui, it helps indeed.. at first, I've been trying to data.frame the output of mean (mycenfit) by the following: my.df<-as.data.frame(do.call(rbind, mean(mycenfit))) and it worked out correctly! ...but because I also needed the information about "n" and "n.cen", which are not provided b

Re: [R] Splitting columns and forming new data files in R

2014-04-10 Thread Zilefac Elvis
Great. Thanks AK. On Thursday, April 10, 2014 11:14 PM, arun wrote: Hi, Ok, In that case, change `lst1New`.  Also, in your files, there was no "Sim" column.  So, I changed the name. lst1New <- lapply(lst1,function(x) {lst2 <- setNames(lapply(x,function(y) {dat <- read.table(y,sep=" ",head

Re: [R] Splitting columns and forming new data files in R

2014-04-10 Thread arun
Hi, Ok, In that case, change `lst1New`.  Also, in your files, there was no "Sim" column.  So, I changed the name. lst1New <- lapply(lst1,function(x) {lst2 <- setNames(lapply(x,function(y) {dat <- read.table(y,sep=" ",header=TRUE, stringsAsFactors=FALSE);names(dat)[5] <- "Sim"; dat[,1:5]}),na

Re: [R] how to select an element from a vector based on a probability

2014-04-10 Thread Frede Aakmann Tøgersen
I think you have calculated the wrong probabilities. Shouldn't it be > x <- c(2,2,6,2,1,1,1,3) > MASS::fractions(table(x)/length(x)) x 1 2 3 6 3/8 3/8 1/8 1/8 > Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology

Re: [R] Version R-3.1.0 for Windows

2014-04-10 Thread Sheng Li
Thank you very much for both of you! Cheers, Sheng On Thu, Apr 10, 2014 at 7:02 PM, Erin Hodgess wrote: > thank you! Just wanted to make sure. > > > On Thu, Apr 10, 2014 at 6:00 PM, Uwe Ligges < > lig...@statistik.tu-dortmund.de > > wrote: > > > > > > > On 11.04.2014 00:36, Erin Hodgess wrote:

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-10 Thread Hurr
Yes, the initial question is answered and the code works. I suppose that I should not have added more to it. I should have posted a new topic. Sorry that I am not at all an R user. Just trying to determine if I want to use it. I just read your link. Sorry to be more stupid than you expect. I did no

[R] How to make a proper use of blocking in limma using voom

2014-04-10 Thread Catalina Aguilar Hurtado
Hi Steve, Thanks for you reply. I have tried what you suggested and checked the limma guide sessions. Now I am getting the results from only one treatment which is great but the problem is all my adjusted Pvalues (adj.P.Val) are >0.05. Don't really know how to solve this, I know my data works be

Re: [R] Determining 32- vs. 64-bit Windows

2014-04-10 Thread Fisher Dennis
Peter Your proposal appears to work better than expected: On a 64-bit machine, it reported 64 when R64 was launched 32 when R62 was launched On a 32-bit machine, it reported 32. The underlying issue for me is that I am calling c code — I want t

[R] Options in Blotter

2014-04-10 Thread Noah Silverman
Hi, I'm inserting a ton of old trading history into the blotter package for some analysis. A bunch of the trades were for options (and a few for futures.) Blotter uses the Financial Instruments package to define the meta-data, and documentation there is clear on how to setup an option and relate

Re: [R] better an error?

2014-04-10 Thread Rolf Turner
The behaviour that you get is exactly the behaviour that I, at least, would expect, and it seems to me to be exactly the correct behaviour. I do not understand what you are complaining about. cheers, Rolf Turner On 11/04/14 06:31, ivo welch wrote: I just spent about an hour bug-tracking.

Re: [R] Version R-3.1.0 for Windows

2014-04-10 Thread Erin Hodgess
thank you! Just wanted to make sure. On Thu, Apr 10, 2014 at 6:00 PM, Uwe Ligges wrote: > > > On 11.04.2014 00:36, Erin Hodgess wrote: > >> Hello! >> >> I like to build from source on Windows (64 bit). >> >> Will the Rtools be updated along with the new tar.gz file, please? >> > > The Rtools p

Re: [R] Version R-3.1.0 for Windows

2014-04-10 Thread Uwe Ligges
On 11.04.2014 00:36, Erin Hodgess wrote: Hello! I like to build from source on Windows (64 bit). Will the Rtools be updated along with the new tar.gz file, please? The Rtools page tells us: Rtools31.exeR 3.0.x to 3.1.x So this is the right one... Best, Uwe Ligges Thanks, Erin

[R] Version R-3.1.0 for Windows

2014-04-10 Thread Erin Hodgess
Hello! I like to build from source on Windows (64 bit). Will the Rtools be updated along with the new tar.gz file, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com

[R] better an error?

2014-04-10 Thread ivo welch
I just spent about an hour bug-tracking. I had expected the following to throw an error: d <- data.frame( x=1:5, y=6:10 ) valid <- c(TRUE, FALSE) d[valid,] I understand that R recycles "when fit," but I had not expected it to recycle, then truncate, and not give even a warning. maybe ther

Re: [R] how to select an element from a vector based on a probability

2014-04-10 Thread Boris Steipe
But your original approach was more concise - just use unique() for the input vector (since neither length nor order matter) and the probabilities: a <- c(1,1,1,1,2,5) set.seed(11235813) out <- sample(unique(a), 100, replace=TRUE, prob = unique(a)) out [1] 5 5 5 2 5 5 1 1 5 2 5 2 5 5 1 5 1 2

Re: [R] Plotting a 3D surface from three variables

2014-04-10 Thread David Winsemius
On Apr 10, 2014, at 5:58 AM, Kumsa wrote: > I'm trying to produce a 3d plot with wireframe function or any other > package in R . I want to show how z changes in response to x and y. But I > fail to produce a 3d surfaceplot with a wireframe command which gives me > different error messages.

[R] Mixed models negative binomial, Error in eval(expr, envir, enclos)

2014-04-10 Thread Karina Charest Castro
Hi! I am trying to do a glmer.nb but get this error: Error in eval(expr, envir, enclos) : ..2 used in an incorrect context, no ... to look in My data structure is data.frame Here my data set: d1_2 Year ID Age Reproductive_status Rank_Residuals Asso.Y1 TotalY1 1994 109 8 Lactating 0.23947902 9 4

Re: [R] Binom.test - hudge difference in p-value for little differences in PD forecast

2014-04-10 Thread peter dalgaard
On 10 Apr 2014, at 16:49 , Alwina Hermann wrote: > Dear R team, > > I'm not sure if I use the right distribution list, but I hope in case if > not, you will forward it to the reference person. > > Following problem occured: > I used R to calculate the p-value for the two sided binomial test

Re: [R] how to select an element from a vector based on a probability

2014-04-10 Thread Rui Barradas
Sorry, there's a bug. merge() sorts the data.frame so we need to sort x also. sample(sort(x), 1, prob = prob) Rui Barradas Em 10-04-2014 21:34, Rui Barradas escreveu: Hello, Inline. Em 10-04-2014 21:04, Nordlund, Dan (DSHS/RDA) escreveu: -Original Message- From: r-help-boun...@r-pr

Re: [R] how to select an element from a vector based on a probability

2014-04-10 Thread Rui Barradas
Hello, Inline. Em 10-04-2014 21:04, Nordlund, Dan (DSHS/RDA) escreveu: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Simone Gabbriellini Sent: Thursday, April 10, 2014 11:59 AM To: Rui Barradas Cc: r-help@r-project.org Subject:

Re: [R] Determining 32- vs. 64-bit Windows

2014-04-10 Thread peter dalgaard
I believe that b. is .Machine$sizeof.pointer*8. I am not aware of a method to figure out the difficult part of a.: whether a 32 bit R is running on 64 bit Windows. I'd expect that you have to ask the OS somehow. Google coughs up one or two interesting pointers. -pd On 10 Apr 2014, at 21:48

Re: [R] Determining 32- vs. 64-bit Windows

2014-04-10 Thread Nordlund, Dan (DSHS/RDA)
Look at Sys.info() R.version() Hope this is helpful, Dan Daniel J. Nordlund, PhD Research and Data Analysis Division Services & Enterprise Support Administration Washington State Department of Social and Health Services From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]

Re: [R] how to select an element from a vector based on a probability

2014-04-10 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Simone Gabbriellini > Sent: Thursday, April 10, 2014 11:59 AM > To: Rui Barradas > Cc: r-help@r-project.org > Subject: Re: [R] how to select an element from a vector based on a >

Re: [R] Plotting Simple Slopes with Multilevel Categorical Moderator

2014-04-10 Thread Richard M. Heiberger
I think you are looking for analysis of covariance. Try the ancova function in the HH package. install.packages("HH") library(HH) ?ancova demo("ancova") On Thu, Apr 10, 2014 at 10:48 AM, Patzelt, Edward wrote: > R - > > I've got a DV with 2 IVs one of which has 5 levels. I tried using the > "peq

[R] Elliptic Fourier Analysis and PCA

2014-04-10 Thread Violette Bertrand
Hi, I use packages "momocs" and "ade4" to dertermine morphometry of woodpeckers' cavities entrances. I have few questions about the PCA (non-normalized) (see image enclosed) :   1) *What do show the confidence ellipses ?*  Some papers say that ellipses include 95 % of the data, but it seems

[R] Determining 32- vs. 64-bit Windows

2014-04-10 Thread Fisher Dennis
3.0.2 Windows Colleagues, If I am setting up code for others and I don’t know their configuration, what is the simplest way to find out the following within R: a. is the system 32- or 64-bit? b. if the system is 64-bit, is R 32- or 64-bit? Dennis Dennis Fisher MD P < (The "P

Re: [R] Modeling presence only data in R

2014-04-10 Thread Jorge Luis Renteria
Dear Friends I am running some SDM to assess the potential distribution of some plant species. We want to run 3 models using presence data only (BIOBLIM, DOMIAN, MAHAL). I am using the Dismo library for R. We would like to evaluate the three models using the AUC the Kappa COR (Pearson correl

[R] Plotting a 3D surface from three variables

2014-04-10 Thread Kumsa
I'm trying to produce a 3d plot with wireframe function or any other package in R . I want to show how z changes in response to x and y. But I fail to produce a 3d surfaceplot with a wireframe command which gives me different error messages. ## Generate data x <- seq(from=0, to=100,by=1) y <-

[R] Regarding the DLL creation in R

2014-04-10 Thread Vijayakumar Chinnamuthu
Hi, We are planning to use R tool for one of the project. We would like to create the dll . My level is novice. Could you please help me to create the dll in R and how to call the R dll in .Net. Thanks for the support Thanks, Vijay CAUTION - Disclaimer * This

[R] Plotting Simple Slopes with Multilevel Categorical Moderator

2014-04-10 Thread Patzelt, Edward
R - I've got a DV with 2 IVs one of which has 5 levels. I tried using the "pequod" package; however found that it is not able to graph/simple slope a moderator with multiple levels. Is there a package available to do this? (data below) dat$gpa <- as.factor(dat$gpa) mod1 <- lmres(item25 ~ psd * g

[R] Binom.test - hudge difference in p-value for little differences in PD forecast

2014-04-10 Thread Alwina Hermann
Dear R team,   I'm not sure if I use the right distribution list, but I hope in case if not, you will forward it to the reference person.   Following problem occured: I used R to calculate the p-value for the two sided binomial test (exact - Pearson). For a very little difference for my forecast I

Re: [R] how to select an element from a vector based on a probability

2014-04-10 Thread Simone Gabbriellini
Hello, Rui, it does, indeed! thanks, Simone 2014-04-10 20:55 GMT+02:00 Rui Barradas : > Hello, > > Use ?sample. > > sample(x, 1, prob = x) > > Hope this helps, > > Rui Barradas > > Em 10-04-2014 19:49, Simone Gabbriellini escreveu: > >> Hello List, >> >> I have an array like: >> >> c(4, 3, 5, 4,

Re: [R] how to select an element from a vector based on a probability

2014-04-10 Thread Rui Barradas
Hello, Use ?sample. sample(x, 1, prob = x) Hope this helps, Rui Barradas Em 10-04-2014 19:49, Simone Gabbriellini escreveu: Hello List, I have an array like: c(4, 3, 5, 4, 2, 2, 2, 4, 2, 6, 6, 7, 5, 5, 5, 10, 10, 11, 10, 12, 10, 11, 9, 12, 10, 36, 35, 36, 36, 36, 35, 35, 36, 37, 35, 35, 38

[R] how to select an element from a vector based on a probability

2014-04-10 Thread Simone Gabbriellini
Hello List, I have an array like: c(4, 3, 5, 4, 2, 2, 2, 4, 2, 6, 6, 7, 5, 5, 5, 10, 10, 11, 10, 12, 10, 11, 9, 12, 10, 36, 35, 36, 36, 36, 35, 35, 36, 37, 35, 35, 38, 35, 38, 36, 37, 36, 36, 37, 36, 35, 35, 36, 36, 35, 35, 36, 35, 38, 35, 35, 35, 36, 35, 35, 35, 6, 5, 8, 6, 6, 7, 1, 7, 7, 8, 9,

[R] How I can program comp() routine

2014-04-10 Thread Endy BlackEndy
Group T Status Dear R users. I am trying to program the comp() routine in package survMisc. 1 2081 0 I am reading the data on the left with d=read.table( "C:\\e.t.c",fill=TRUE,header=TRUE) 1 1602 0 Then I load the packages 'survival' and

Re: [R] print(cenfit object) to a data.frame

2014-04-10 Thread Rui Barradas
Hello, Perhaps the easiest way is with ?capture.output: dat <- read.table(text = capture.output(print(mycenfit)), stringsAsFactors = FALSE) str(dat) 'data.frame': 3 obs. of 5 variables: $ n : int 3 3 3 $ n.cen : int 1 1 2 $ median: int 2 2 NA $ mean : num 2.33 2.33 2 $ sd

[R] print(cenfit object) to a data.frame

2014-04-10 Thread Massimo Bressan
given this reproducible example: #start code df<-structure(list(lq = c(TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE), value = c(1, 3, 1, 2, 0.5, 2, 1, 2, 3), group = structure(c(1L, 1L, 2L, 2L, 3L, 3L, 3L, 1L, 2L), .Label = c("A", "B", "C"), class = "factor")), .Names = c("lq", "v

Re: [R] premature evaluation of symbols. Is that the way to describe this problem?

2014-04-10 Thread peter dalgaard
On 10 Apr 2014, at 16:59 , Paul Johnson wrote: > I've been reading quite a while on this question, testing lots of > ideas. The quote function seems to work, but I worry about how the R > runtime environment finds all the pieces if I pass them through this > way. > > mySpecialFeature <- functio

[R] premature evaluation of symbols. Is that the way to describe this problem?

2014-04-10 Thread Paul Johnson
Dear eveRybody In the package rockchalk, I have functions that take regressions and make tables and plots. Sometimes I'll combine a model with various arguments and pass the resulting list around to be executed, usually using do.call. While debugging a function on a particularly large dataset, I

Re: [R] Memory allocation using .C interface

2014-04-10 Thread Cassiano dos Santos
Ok, that is why i have suspected. Thanks for the clear explanation. []s Cassiano 2014-04-09 18:37 GMT-03:00 Peter Langfelder : > On Wed, Apr 9, 2014 at 11:27 AM, Cassiano dos Santos > wrote: > > I am testing a call to a C function from R, using .C interface. The test > > consists in passing

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

2014-04-10 Thread William Revelle
I am probably going to push it to CRAN today or tomorrow. Bill On Apr 10, 2014, at 1:22 AM, sagnik chakravarty wrote: > Thanks a lot Bill and Revelle for your helpful response. > It would have been great if I could know when we can expect the release of > the edited version 1.4.4. > > Sagnik

Re: [R] simulation data

2014-04-10 Thread Charles Determan Jr
Thanoon, My reply to your previous post should be more than enough for you to accomplish your goal. Please look over that script again: ords <- seq(4) p <- 10 N <- 1000 percent_change <- 0.9 R <- as.data.frame(replicate(p, sample(ords, N, replace = T))) or alternatively as Mr. Barradas suggest

[R] ggplot: vertical text annotation, outside plot region

2014-04-10 Thread Rguy
In traditional R graphics I can generate text annotations that are vertical, and that lie outside the plot region, using the mtext function. I'd like to do the same thing in ggplot2. Is it possible? The documentation for 'annotate' does not mention such possibilities. Thanks. [[alternati

[R] mean fn in combination with by() XXXX

2014-04-10 Thread Dan Abner
Hi all, Can anyone please explain the following results (why does median() work here but not mean())? Is there a fix or work around for this? Thanks, Dan > by(urpdata[,2],urpdata[,12],mean,na.rm=TRUE) Error in FUN(X[[1L]], ...) : could not find function "FUN" > by(urpdata[,2],urpdata[,12],med

Re: [R] Meta-analysis of prevalence at the country level with mgcv/gamm4

2014-04-10 Thread Julien Riou
> > Message: 11 > Date: Wed, 09 Apr 2014 18:39:30 +0100 > From: Michael Dewey > To: Julien Riou , r-help@r-project.org > Subject: Re: [R] Meta-analysis of prevalence at the country level with > mgcv/gamm4 > Message-ID: > Content-Type: text/plain; charset="us-ascii"; format=flowed > Hi M

[R] R speed test - for processor and for RAM size

2014-04-10 Thread Dimitri Liakhovitski
Hello! I am sorry if my question sounds naive; it's because I am not a computer scientist. I understand that two factors impact a PC's speed, the processor and (indirectly), the RAM size. I would like to run a speed test in R (under Windows). I found lots of different code snippets testing the sp

[R] R 3.1.0 is released

2014-04-10 Thread Peter Dalgaard
(Resend with correct Subject field.) The build system rolled up R-3.1.0.tar.gz (codename "Spring Dance") this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.1.0.tar.gz or wait for it to be mirrored at a

[R] R 3.0.3 is released

2014-04-10 Thread Peter Dalgaard
The build system rolled up R-3.1.0.tar.gz (codename "Spring Dance") this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.1.0.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries for

Re: [R] simulation data

2014-04-10 Thread Rui Barradas
Hello, At an R prompt type ?rbinom ?replicate Hope this helps, Rui Barradas Em 10-04-2014 02:28, thanoon younis escreveu: hi i want to simulate multivariate dichotomous data matrix with categories (0,1) and n=1000 and p=10. thanks alot in advance [[alternative HTML version deleted

Re: [R] logistical indexing in R

2014-04-10 Thread PIKAL Petr
Hi Your approach seems to be rather complicated. Just change your values into NA. data$ej[data$ej=="-97"] <- NA Then you can use is.na function to select and replace na values. However it seems to me that your data are not numeric and I am not sure if it is intended or not. If you want mo