[R] read a text file with variable number of spaces

2011-03-02 Thread Gregory Ryslik
Hi, I seem to be having somewhat of an unusual data input problem with some of the data sets I'm working with and want to run a simulation on. in the first data set I'm looking at, I have a text file where the spacing between columns varies. I've attached a snippet. Is there a way to read this

Re: [R] Creating a weighted sample - Help

2011-03-02 Thread P Ehlers
LouiseS wrote: Hi I'm new to R and most things I want to do I can do but I'm stuck on how to weight a sample. I have had a look through the post but I can't find anything that addresses my specific problem. I am wanting to scale up a sample which has been taken based on a single variable (perf

Re: [R] how to delete empty levels from lattice xyplot

2011-03-02 Thread P Ehlers
Dennis Murphy wrote: Hi: On Wed, Mar 2, 2011 at 1:52 PM, John Smith wrote: Hello All, I try to use the attached code to produce a cross over plot. There are 13 subjects, 7 of them in for/sal group, and 6 of them in sal/for group. But in xyplot, all the subjects are listed in both subgraphs.

Re: [R] Non-conformable arrays

2011-03-02 Thread Gregory Ryslik
Perfect! Thank you! On Mar 2, 2011, at 10:55 PM, wrote: > Here is one way. > > 1. make sure y.test is a factor > > 2. Use > > table(y.test, > factor(PredictedTestCurrent, levels = levels(y.test)) > > 3. If PredictedTestCurrent is already a factor with the wrong levels, turn it > back in

Re: [R] What am I doing wrong with this loop ?

2011-03-02 Thread Bill.Venables
Here is a start > x <- as.data.frame(runif(2000, 12, 38)) > length(x) [1] 1 > names(x) [1] "runif(2000, 12, 38)" > Why are you turning x and y into data frames? It also looks as if you should be using if(...) ... else ... rather than ifelse(.,.,), too. You need to sort out a few issues, it se

[R] What am I doing wrong with this loop ?

2011-03-02 Thread eric
What is wrong with this loop ? I am getting an error saying incorrect number of dimensions y[i,2] x <- as.data.frame(runif(2000, 12, 38)) z <-numeric(length(x)) y <- as.data.frame(z) for(i in 1:length(x)) { y <- ifelse(i < 500, as.data.frame(lowess(x[1:i,1], f=1/9)) , as.data.frame(lowess(x[(i-

Re: [R] Non-conformable arrays

2011-03-02 Thread Bill.Venables
Here is one way. 1. make sure y.test is a factor 2. Use table(y.test, factor(PredictedTestCurrent, levels = levels(y.test)) 3. If PredictedTestCurrent is already a factor with the wrong levels, turn it back into a character string vector first. -Original Message- From: r-help-boun

Re: [R] how to delete empty levels from lattice xyplot

2011-03-02 Thread Dennis Murphy
Hi: On Wed, Mar 2, 2011 at 1:52 PM, John Smith wrote: > Hello All, > > I try to use the attached code to produce a cross over plot. There are 13 > subjects, 7 of them in for/sal group, and 6 of them in sal/for group. But > in > xyplot, all the subjects are listed in both subgraphs. Could anyone

[R] Non-conformable arrays

2011-03-02 Thread Gregory Ryslik
Hi Everyone, I'm running some simulations where eventually I need to table the results. The problem is, that while most simulations I have at least one predicted outcome for each of the six possible categories, sometimes the algorithm assigns all the outcomes and one category is left out. Thus

Re: [R] transform table to matrix

2011-03-02 Thread Scott Chamberlain
Agreed Peter: weird. What is the purpose of your inquiry SK? And why is your inquiry so similar to the one at the hyperlink I provided? Scott On Wednesday, March 2, 2011 at 6:10 PM, P Ehlers wrote: > Scott Chamberlain wrote: > > This thread seems freakishly similar to what you are askingSco

Re: [R] transform table to matrix

2011-03-02 Thread P Ehlers
Scott Chamberlain wrote: This thread seems freakishly similar to what you are askingScott Even to the point of including the same typo as well as proof that neither poster bothered to read the posting guide. Great spot, Scott! Peter Ehlers http://tolstoy.newcastle.edu.au/R/help/06/07/3

Re: [R] Create a zoo/xts Time Series with Millisecond jumps

2011-03-02 Thread Gabor Grothendieck
On Wed, Mar 2, 2011 at 5:14 PM, rivercode wrote: > Is there a easy way to create the time index for a zoo/xts object for every > 100 milliseconds. > > eg.  time Index would be: > > 10:00:00:100 > 10:00:00:200 > 10:00:00:300 > 10:00:00:400 > > I am looking to build an empty zoo/xts object with time

Re: [R] merge( , by='row.names') slowness

2011-03-02 Thread rex.dwyer
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of dms Sent: Wednesday, March 02, 2011 3:16 PM To: r-help@r-project.org Subject: [R] merge( , by='row.names') slowness I noticed that joining two data.frames in R using the "merge" fun

[R] parallel bootstrap linear model on multicore mac (re-post)

2011-03-02 Thread Anthony Dick
Hello all, I am re-posting my previous question with a simpler, more transparent, commented code. I have been ramming my head against this problem, and I wondered if anyone could lend a hand. I want to make parallel a bootstrap of a linear mixed model on my 8-core mac. Below is the process that I

[R] looping through data in sections and performing a function on each one

2011-03-02 Thread Ryan Poole
Hi, I have a series of data (y) against the time of day (x), for simplicity consider: x=c(0,1,2,3,4,5,6,7,8,9,10) y=c(0,1,2,3,0,-1,-2,1,2,1,0) I wish to loop through the y values and and at the point where they touch or cross the x axis, subtract the previous times of day from this point, and

[R] Create a zoo/xts Time Series with Millisecond jumps

2011-03-02 Thread rivercode
Is there a easy way to create the time index for a zoo/xts object for every 100 milliseconds. eg. time Index would be: 10:00:00:100 10:00:00:200 10:00:00:300 10:00:00:400 I am looking to build an empty zoo/xts object with time index from 10am to 3pm, index jumps by 100ms each row. Thanks, Chri

Re: [R] clustering problem

2011-03-02 Thread Maxim
Sure, but in the end I like to call clusters of genes and not of samples. Actually the experiment is a time-lapse experiment, therefore the samples (columns) are fixed anyway. I guess my misunderstanding is that I get clustering of rows in the latter case (with dist(t(matrix))) because it's actua

[R] how to delete empty levels from lattice xyplot

2011-03-02 Thread John Smith
Hello All, I try to use the attached code to produce a cross over plot. There are 13 subjects, 7 of them in for/sal group, and 6 of them in sal/for group. But in xyplot, all the subjects are listed in both subgraphs. Could anyone help me figure out how to get rid of the empty levels? Thanks l

Re: [R] a question on sqldf's handling of missing value and factor

2011-03-02 Thread Gabor Grothendieck
On Wed, Mar 2, 2011 at 10:17 AM, xin wei wrote: > I am sorry for posting the wrong source file. the correct source file is as > follows: > a       b       c > aa              23 > aaa     34.6 >            77.8 > > They are tab delimited but somehow could not be displayed correctly in > brows

Re: [R] clustering problem

2011-03-02 Thread rex.dwyer
Don't you expect it to be a lot faster if you cluster 20 items instead of 25000? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Maxim Sent: Wednesday, March 02, 2011 4:08 PM To: r-help@r-project.org Subject: [R] clustering problem

[R] clustering problem

2011-03-02 Thread Maxim
Hi, I have a gene expression experiment with 20 samples and 25000 genes each. I'd like to perform clustering on these. It turned out to become much faster when I transform the underlying matrix with t(matrix). Unfortunately then I'm not anymore able to use cutree to access individual clusters. In

Re: [R] how many records for suitable regression

2011-03-02 Thread Greg Snow
It really depends on what question you are trying to answer. Things like the relative importance of type I and type II errors could matter a lot. Correlation among the predictors can affect things. What effect size are you looking for and what power do you want? And much more. There is a ge

Re: [R] GLM / Logistic Regression Problem

2011-03-02 Thread Bert Gunter
Please read the Help for predict.glm carefully to make sure you are not confusing predicted response on the linear scale (log odds) with that on the probability scale. The warning is just that: a warning. It means that you have fitted PROBABILITIES on the boundary, which might compromise the itera

[R] thank you

2011-03-02 Thread Umesh Rosyara
Hi Dennis I was able to my problem. Thank you encouragement and time. n<-7 newvars <- c(paste('m', rep(1:n, each = 4), rep(c('a', 'b')), rep(c('p1', 'p2'), each = 2), sep = '')) newvars [1] "m1ap1" "m1bp1" "m1ap2" "m1bp2" "m2ap1" "m2bp1" "m2ap2" "m2bp2" "m3ap1" [10] "m3bp1" "m3a

[R] Creating a weighted sample - Help

2011-03-02 Thread LouiseS
Hi I'm new to R and most things I want to do I can do but I'm stuck on how to weight a sample. I have had a look through the post but I can't find anything that addresses my specific problem. I am wanting to scale up a sample which has been taken based on a single variable (perf) which has 4 att

[R] Step by step procedure for the application of Threshold model

2011-03-02 Thread Makuachukwu Ojide
Hello Friends, Can you kindly help me with step by step procedure (in terms of the required/necessary statistical tests) before threshold model can be applied in time series analysis? I need to understand all the necessary tests  - ranging from testing the properity of a time serie

[R] GLM / Logistic Regression Problem

2011-03-02 Thread patsko
Hi there, I am encountering a problem with the GLM tool performing logistic regression. After computing a warning appears, saying “glm.fit: fitted probabilities numerically 0 or 1 occurred”. A prediction of new values confirms the problem as the model does not produce regular probability estima

[R] spplot() - costumize the color-legend

2011-03-02 Thread Spindoctor
Hi! Is there a way to manually costumize the color legend in an spplot() - especially where to draw ticks and labels for the ticks? The reason I'm asking: Usually spplot() automatically divides the data into fitting slices and makes a color legend (also automatically). I want to assign the slice

[R] trouble loading ggplot2 using R

2011-03-02 Thread linsleyp
I'm having trouble loading ggplot2 on my mac (Snow Leopard) using R version 2.12.1, as shown below. I can't find a posting relevant to this problem, so any help would be very much appreciated. Thanks, peter l > install.packages('ggplot2', dep = TRUE) trying URL 'http://cran.cnr.Berkeley.edu/b

Re: [R] finding model order components for arima()

2011-03-02 Thread Amar
Amar gmail.com> writes: > > Hi, > I am trying to model a time series using arima(). For getting the > model order components(p, d, q and P,D,Q) I am using procedure > discussed in [1] in section 3.2 . It is most likely hit and trial > method based on lower AIC value. > I want to know what is t

Re: [R] Contingency table in R

2011-03-02 Thread Antony Raj
Hi Laura and R users, I would like to know whether we can do siginificance test between Column Yes and Column No. Any one tried? I have seen it in Tabulaiton software packages from our vendors and in SPSS Custom Table. Thanks, On Wed, Mar 2, 2011 at 7:43 PM, Laura Clasemann wrote: > > Hi, > >

Re: [R] Vector manipulations

2011-03-02 Thread Benjamin Hartley
Thanks Jonathan and Ista, that's really helpful. Got it running much better now. Ben On 2 March 2011 17:33, Jonathan P Daily wrote: > Is this what you want? I don't know what your v looks like, but this won't > work if there are cases in which v won't sum to exactly x. > > x <- 20 > v <- sample

[R] merge( , by='row.names') slowness

2011-03-02 Thread dms
I noticed that joining two data.frames in R using the "merge" function that using by='row.names' slows things down substantially when compared to just joining on a common index column. Using a dataframe size of ~10,000 rows: it's as slow as 10 minutes in the by='row.names' case versus merely 1 s

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Jonathan P Daily
I apologize if I was not clear in my response. I only mentioned x1, x2 in my example, but I did not clarify that I also knew that P(x6 = 1 | x1..5 = 1) = 0 in the original request. I also see that if he meant that he wanted to sample with replacement from the set of sequences that sample(rep(1:2

Re: [R] How to extrapolate a model

2011-03-02 Thread Jannis
I have no experience with this quantreg package and you did not include any code for us to reproduce your problem. But these models in R all work similar. Have a look at the model result object returned by the call of the fit (str(modelresults) ). I would expect that there is some formula com

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Bert Gunter
Folks: On Wed, Mar 2, 2011 at 10:32 AM, Jonathan P Daily wrote: > I will point out again that sampling a five-fold replicate of 1:20 is not > the same as resampling with replacement, -- Correct. In sampling with replacement from 1:20 there is positive probability of getting all 1's or all 2's, e

Re: [R] message: please select CRAN mirror

2011-03-02 Thread Ben Bolker
Aggita eurotransplant.org> writes: > > > chooseCRANmirror() > Error in m[, 1L] : incorrect number of dimensions > > Can someone explain me why I can't choose the cran mirror, but get again and > again this error message. Have searched for this on several engines but > can't find explanation. >

Re: [R] Line numbering in Sweave

2011-03-02 Thread Ista Zahn
SweaveListingUtils might do it. http://cran.r-project.org/web/packages/SweaveListingUtils/index.html Best, Ista On Wed, Mar 2, 2011 at 12:30 PM, Giovanni Petris wrote: > Is there a way of getting line numbers in Schunks? Ideally, I would like > to have numbers printed every two or five lines. >

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Giovanni Petris
But this seems to me to be equivalent to sample(rep(1:20, 5), 20), which I previously suggested and was pointed out to be wrong Giovanni On Wed, 2011-03-02 at 11:05 -0700, Vokey, John wrote: > On 2011-03-02, at 4:00 AM, r-help-requ...@r-project.org wrote: > > > Hello there, > > > > I have

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Jonathan P Daily
I will point out again that sampling a five-fold replicate of 1:20 is not the same as resampling with replacement, although I made an error in reporting probabilities - the P(x2 = 1 | x1 = 1) = 4/99 and not 4/100. When sampling with replacement, P(x2 = 1 | x1 = 1) = P(x2 = 1 | x1 != 1) = 1/20.

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Vokey, John
On 2011-03-02, at 4:00 AM, r-help-requ...@r-project.org wrote: > Hello there, > > I have a problem concerning bootstrapping in R - especially focusing on the > resampling part of it. I try to sum it up in a simplified way so that I would > not confuse anybody. > > I have a small database consi

[R] please help with interaction.plot

2011-03-02 Thread Lathouri, Maria
Dear all I have the following code to produce a graph of 5 different variables in the same graph; however when I follow it in the end it produces the plot of the 5 variables and a legend in right but the problem is that the legend is too close to the margin of the plot and when I try to write t

Re: [R] merge in data.tables -- "non-visible"

2011-03-02 Thread Ted Rosenbaum
Thanks for the help -- merge.data.table was being used! On Wed, Mar 2, 2011 at 12:25 AM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > Hi Ted, > > On Tue, Mar 1, 2011 at 9:45 PM, Ted Rosenbaum > wrote: > > Hi, > > I am trying to use the merge command in the data.tables package. > >

[R] Line numbering in Sweave

2011-03-02 Thread Giovanni Petris
Is there a way of getting line numbers in Schunks? Ideally, I would like to have numbers printed every two or five lines. Thank you in advance, Giovanni -- Giovanni Petris Associate Professor Department of Mathematical Sciences University of Arkansas - Fayetteville, AR 72701 Ph: (479) 575-6

Re: [R] RWinEdt difficulties

2011-03-02 Thread John Seers
>Well, use the manual setup as indicated in the readme cinatined in the package. No idea what went wrong in this case. OK, thanks. John Seers ** *

Re: [R] RWinEdt difficulties

2011-03-02 Thread Uwe Ligges
On 02.03.2011 18:06, John Seers wrote: ** ** 2011/3/2 Uwe Ligges On 01.03.2011 11

Re: [R] RWinEdt difficulties

2011-03-02 Thread John Seers
** ** 2011/3/2 Uwe Ligges > > > On 01.03.2011 11:01, John Seers wrote: > >> Hello Every

Re: [R] power regression: which package?

2011-03-02 Thread Kjetil Halvorsen
?nls install.packages("nls2",dep=T) library(nls2) ?nls2 install.packages("nlstools") library(help=nlstools) install.packages("NISTnls", dep=T) library(help=NISTnls) the last one give access to many examples. On Wed, Mar 2, 2011 at 1:55 PM, David Croll wrote: > > > Dear R users and R friends, > >

Re: [R] RWinEdt difficulties

2011-03-02 Thread John Seers
Thanks Robert. I will have a look at it. John Seers ** ** On Wed, Mar 2, 2011 at 3:10

[R] power regression: which package?

2011-03-02 Thread David Croll
Dear R users and R friends, I have a little problem... I don't know anymore which package to use if I want to perform a power regression analysis. To be clear, I want to fit a regression model like this: fit <- (y ~ a * x ^ b + c) where a, b and c are coefficients of the model. The R

Re: [R] Vector manipulations

2011-03-02 Thread Jonathan P Daily
Is this what you want? I don't know what your v looks like, but this won't work if there are cases in which v won't sum to exactly x. x <- 20 v <- sample(0:1, 100, T) w <- v[1:which(cumsum(v)==x)] -- Jonathan P. Daily Technician - USGS Leetown Science Center 1

Re: [R] Vector manipulations

2011-03-02 Thread Ista Zahn
Hi Benjamin, There may be faster ways, but v <- 1:100 x <- 10 n <- which(cumsum(v) == x) w <- v[1:n] seems pretty straightforward. Best, Ista On Wed, Mar 2, 2011 at 10:42 AM, Benjamin Hartley wrote: > I have a question regarding the most efficient way to select a substring of > a vector: > > I

Re: [R] Contingency table in R

2011-03-02 Thread Ista Zahn
Hi Laura, On Wed, Mar 2, 2011 at 9:13 AM, Laura Clasemann wrote: > > Hi, > > I have a table in R with data I needed and need to create a contingency table > out of it. The table I have so far looks like this: > > >                   Binger > r > DietType     No Yes >  Dangerous  15  12 >  Health

Re: [R] transform table to matrix

2011-03-02 Thread Scott Chamberlain
This thread seems freakishly similar to what you are askingScott http://tolstoy.newcastle.edu.au/R/help/06/07/30127.html On Wednesday, March 2, 2011 at 7:43 AM, SK MAIDUL HAQUE wrote: > I have a text file that I have imported into R. It contains 3 columns and > 316940 rows. The first column

Re: [R] transform table to matrix

2011-03-02 Thread Ista Zahn
Hi Sk, On Wed, Mar 2, 2011 at 8:43 AM, SK MAIDUL HAQUE wrote: >  I have a text file that I have imported into R. It contains 3 columns and > 316940 rows. The first column is vegetation plot ID, the second species > names and the third is a cover value (numeric). I imported using the > read.table

Re: [R] R and Android

2011-03-02 Thread Marc Schwartz
If you search the list archives (using keywords such as iPhone or iPad), you will see extensive discussions on this point. There is/was an option to install a full R application on so-called "jail broken" Apple mobile units **only**. Otherwise, it's client/server. HTH, Marc Schwartz On Mar 2,

Re: [R] does rpy support R 2.12.2

2011-03-02 Thread José Matos
On Tuesday 01 March 2011 23:36:20 Pete Shepard wrote: > Hi, > > I am getting the following error when I try to run import rpy from the the > python IDE: > > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.6/dist-packages/rpy.py", line 134, in > """ % RV

Re: [R] transform table to matrix

2011-03-02 Thread Sarah Goslee
If I understand you correctly, the easiest thing to do is import the data without converting the strings to factors (the default behavior) using: mydata <- read.table("mydata.csv", as.is=TRUE) If that isn't actually your problem, the output of str(mydata) would be helpful, as would an actual examp

Re: [R] Plot with same font like in LaTeX

2011-03-02 Thread Abhijit Dasgupta
The tikzDevice package can do this. On 3/2/2011 6:48 AM, Jonas Stein wrote: > Hi, > > i want to make my plots look uniform in LaTeX documents. > > - usage of the same font on axes and in legend like LaTeX uses >(for example "Computer Modern") > > - put real LaTeX formulas on the axes > > Hav

Re: [R] Plot with same font like in LaTeX

2011-03-02 Thread Erik Iverson
Jonas, Try looking at the tikzDevice package, and/or the pgfSweave package. --Erik Jonas Stein wrote: Hi, i want to make my plots look uniform in LaTeX documents. - usage of the same font on axes and in legend like LaTeX uses (for example "Computer Modern") - put real LaTeX formulas on th

Re: [R] Rcommander

2011-03-02 Thread John Fox
Dear Scott, I assume that Selda has already done this, but if not, the Rcmdr would still start and then offer to install its dependencies. Best, John John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University

Re: [R] message: please select CRAN mirror

2011-03-02 Thread Uwe Ligges
On 02.03.2011 16:47, Aggita wrote: chooseCRANmirror() Error in m[, 1L] : incorrect number of dimensions Can someone explain me why I can't choose the cran mirror, but get again and again this error message. Have searched for this on several engines but can't find explanation. Thanks a lot in a

Re: [R] *** caught segfault *** when using impute.knn (impute package)

2011-03-02 Thread Peter Langfelder
On Wed, Mar 2, 2011 at 6:31 AM, Bettina Kulle Andreassen wrote: > hi, > > i am getting an error when calling the impute.knn > function (see the screenshot below). > what is the problem here and how can it be solved? > > > screenshot: > > ## >  *** caught segfault *** > address 0x51

Re: [R] inefficient ifelse() ?

2011-03-02 Thread rex.dwyer
Hi Ivo, It might be useful for you to study the examples below. The key from a programming language point of view is that functions like ifelse are functions of whole vectors, not elements of vectors. You either evaluate an argument or you don't; you don't evaluate only part of argument. (Someb

Re: [R] Plot with same font like in LaTeX

2011-03-02 Thread Ista Zahn
Have a look at the tikzDevice package. Best, Ista On Wed, Mar 2, 2011 at 6:48 AM, Jonas Stein wrote: > Hi, > > i want to make my plots look uniform in LaTeX documents. > > - usage of the same font on axes and in legend like LaTeX uses >  (for example "Computer Modern") > > - put real LaTeX formu

Re: [R] Plot with same font like in LaTeX

2011-03-02 Thread Claudia Beleites
Jonas, have a look at tikzdevice Claudia -- Claudia Beleites Dipartimento dei Materiali e delle Risorse Naturali Università degli Studi di Trieste Via Alfonso Valerio 6/a I-34127 Trieste phone: +39 0 40 5 58-37 68 email: cbelei...@units.it __ R-help@

[R] Probit Analysis and Interval Calculations for different LD50s

2011-03-02 Thread Colleen Kenney
I am encountering a problem with the calculation of Fieller and Delta Method confidence intervals when performing probit analysis on simulated data; my code is included below. I am testing 5 dose groups, with log doses (-0.2, -0.1, 0, 0.1, 0.2) and (1.8, 1.9, 2, 2.1, 2.2) so that the log(LD50) are

[R] Question regarding vector manipulation

2011-03-02 Thread Benjamin Hartley
I have a question regarding the most efficient way to select a substring of a vector: I have a vector of value v, and I want to select a subspace of this vector called w such that: w=v[1:n] where sum(w) = x I am interested in what you thing would be the most efficient way to do this - I wou

Re: [R] *** caught segfault *** when using impute.knn (impute package)

2011-03-02 Thread Uwe Ligges
On 02.03.2011 15:31, Bettina Kulle Andreassen wrote: hi, i am getting an error when calling the impute.knn function (see the screenshot below). what is the problem here and how can it be solved? Please write to the package maintainers. This is probably a bug in the package. Uwe Ligges

Re: [R] a question on sqldf's handling of missing value and factor

2011-03-02 Thread xin wei
Dear Mr. Grothendieck : thank you so much for your attention. You are the real expert here. the following is a mock text file: a b c aa 23 aaa 34 77 note that both b and c column contain missing value (blank) I save it under my C drive and use bo

[R] Vector manipulations

2011-03-02 Thread Benjamin Hartley
I have a question regarding the most efficient way to select a substring of a vector: I have a vector of value v, and I want to select a subspace of this vector called w such that: w=v[1:n] where sum(w) = x I am interested in what you thing would be the most efficient way to do this - I would

Re: [R] a question on sqldf's handling of missing value and factor

2011-03-02 Thread xin wei
I am sorry for posting the wrong source file. the correct source file is as follows: a b c aa 23 aaa 34.6 77.8 They are tab delimited but somehow could not be displayed correctly in browser. -- View this message in context: http://r.789695.n4.nab

[R] Contingency table in R

2011-03-02 Thread Laura Clasemann
Hi, I have a table in R with data I needed and need to create a contingency table out of it. The table I have so far looks like this: Binger r DietType No Yes Dangerous 15 12 Healthy52 9 None 134 24 Unhealthy 72 23 These are the error message

[R] Selecting a subsample so that it follows a distribution.

2011-03-02 Thread Bryo
Hi All, I want to select rows at random from a large data.frame while achieving a particular distribution defined my a given subset of this data.frame. How can I do this? More details and what I've done so far is given below. I have gene expression data and gene sets of interest. In order to loo

[R] how many records for suitable regression

2011-03-02 Thread agent dunham
Dear community, I was wondering if it's possible to know if you have enough data for a regression study. I remember you must have more data than parameters to obtain, but I'd like to know if there was something more sophisticated. Thanks, u...@host.com -- View this message in context: http:/

Re: [R] problem with glm(family=binomial) when some levels have only 0 proportion values

2011-03-02 Thread csrabak
Em 2/3/2011 08:01, Jürg Schulze escreveu: Hello everybody This is not a R related problem, but rather more theoretic one, anyway: I want to compare the proportions of germinated seeds (seed batches of size 10) of three plant types (1,2,3) with a glm with binomial data (following the method i

[R] transform table to matrix

2011-03-02 Thread SK MAIDUL HAQUE
I have a text file that I have imported into R. It contains 3 columns and 316940 rows. The first column is vegetation plot ID, the second species names and the third is a cover value (numeric). I imported using the read.table function. My problem is this. I need to reformat the information as a

[R] finding model order components for arima()

2011-03-02 Thread Amar
Hi, I am trying to model a time series using arima(). For getting the model order components(p, d, q and P,D,Q) I am using procedure discussed in [1] in section 3.2 . It is most likely hit and trial method based on lower AIC value. I want to know what is the correct way to find model order compon

Re: [R] R and Android

2011-03-02 Thread Mike Marchywka
> Date: Wed, 2 Mar 2011 11:44:41 + > From: ali.zolfagh...@gmail.com > To: r-help@r-project.org > Subject: [R] R and Android > > Hi List, > Is anybody aware of any R console available for Android mobile? I know that > there is one for Iphone. I was j

Re: [R] Rcommander

2011-03-02 Thread Scott Chamberlain
install.packages("Rcmdr", dependencies=TRUE) library(Rcmdr) Scott On Wednesday, March 2, 2011 at 2:41 AM, Selda Korkmaz wrote: > Dear Sirs, > > i just downloaded the R programm on my Macbook, but I can´t open Rcmdr, > although I installed the needed Rcmdr-packages. I would be very happy, if y

[R] The other Question of "Censored Quantile Regression for Longitudinal Data"

2011-03-02 Thread newhonewind
How to solve the panel data of cqr by writing the R code or using the "quantreg" ? Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Question-of-Quantile-Regression-for-Longitudinal-Data-tp883458p3331318.html Sent from the R help mailing list archive at Nabble.com. __

[R] Plot with same font like in LaTeX

2011-03-02 Thread Jonas Stein
Hi, i want to make my plots look uniform in LaTeX documents. - usage of the same font on axes and in legend like LaTeX uses (for example "Computer Modern") - put real LaTeX formulas on the axes Have you any hints how i can achieve that? I had no luck two years ago, but i want to try it again

[R] *** caught segfault *** when using impute.knn (impute package)

2011-03-02 Thread Bettina Kulle Andreassen
hi, i am getting an error when calling the impute.knn function (see the screenshot below). what is the problem here and how can it be solved? screenshot: ## *** caught segfault *** address 0x513c7b84, cause 'memory not mapped' Traceback: 1: .Fortran("knnimp", x, ximp = x, p,

[R] message: please select CRAN mirror

2011-03-02 Thread Aggita
> chooseCRANmirror() Error in m[, 1L] : incorrect number of dimensions Can someone explain me why I can't choose the cran mirror, but get again and again this error message. Have searched for this on several engines but can't find explanation. Thanks a lot in advance! -- View this message in con

[R] How to extrapolate a model

2011-03-02 Thread sadz a
I am using a multiple additive model (in the quantreg package) and I would like to 'extract' the fitted model formulae ie- for a straight line the formula would be y= 'a+b*c' for my multiple model I would expect somthing more complex because the model is not linear (its a bit like a GAM) but given

Re: [R] how to simplify a data.frame and add the counts of duplicate rows as a new column

2011-03-02 Thread Simone Gabbriellini
many thanks, this is really a great solution! best, Simone Il giorno 02/mar/2011, alle ore 16.22, Scott Chamberlain ha scritto: > see package plyr, especially the function ddply(), eg.., in your case: > > ddply(dataframe, .(columnA, columnB), summarise, > columnC = length(columnB) > ) >

Re: [R] how to simplify a data.frame and add the counts of duplicate rows as a new column

2011-03-02 Thread Scott Chamberlain
see package plyr, especially the function ddply(), eg.., in your case: ddply(dataframe, .(columnA, columnB), summarise, columnC = length(columnB) ) Scott On Wednesday, March 2, 2011 at 9:10 AM, Simone Gabbriellini wrote: > Hello List, > > I would like to simplify a data.frame like this > > co

[R] how to simplify a data.frame and add the counts of duplicate rows as a new column

2011-03-02 Thread Simone Gabbriellini
Hello List, I would like to simplify a data.frame like this columnA columnB user10 proj12 user10 proj19 user10 proj12 into something like: columnA columnB columnC user10 proj12 2 user10 proj19 1 I know unique() can simplify the dat

Re: [R] problem with glm(family=binomial) when some levels have only 0 proportion values

2011-03-02 Thread Robert A LaBudde
The algorithm is not converging. Your iterations are at the maximum. It won't do any good to add a fractional number to all data, as the result will depend on the number added (try 1.0, 0.5 and 0.1 to see this). The root problem is that your data are degenerate. Firstly, your types '2' and '

Re: [R] RWinEdt difficulties

2011-03-02 Thread Robert Kinley
try RStudio instead :o) http://www.rstudio.org/ Robert Kinley Uwe Ligges Sent by: r-help-boun...@r-project.org 02/03/2011 15:00 To John Seers cc r-help@r-project.org Subject Re: [R] RWinEdt difficulties On 01.03.2011 11:01, John Seers wrote: > Hello Eve

Re: [R] RWinEdt difficulties

2011-03-02 Thread Uwe Ligges
On 01.03.2011 11:01, John Seers wrote: Hello Everyone I have just upgraded my PC to Windows 7 (64 bit) and I have installed R 2.12.2. R seems to be working fine. I am having problems getting RWinEdt working with it though. I have tried installing WinEdt 6.0 and WinEdt 5.5. But both fail with

Re: [R] Refine ARMA model

2011-03-02 Thread Prof Brian Ripley
Hint: the 'fixed' argument can be used to set a parameter to a fixed value such as zero. With the reproducible example we asked you for, we might have shown you how to use it On Wed, 2 Mar 2011, Chuse chuse wrote: Dear users, I tried to fit an AR(2) model to data. This the result: ar

Re: [R] Rioja package, creating transfer function, WA, "Error in FUN"

2011-03-02 Thread Gavin Simpson
On Thu, 2011-02-10 at 09:40 -0800, mdc wrote: > Hi, I am a new R user and am trying to construct a palaeoenvironmental > transfer function (weighted averaging method) using the package rioja. > I've managed to insert the two matrices (the species abundance and the > environmental data) and have ass

[R] Find downstream values in a network

2011-03-02 Thread Jon Olav Skoien
Dear list, I have a data.frame with segments between river junctions and dimensionless predictions of runoff (runoff/area) at some of these junctions. As I want to plot my values on a continuous river network (this data.frame is part of a SpatialLinesDataFrame), I would like to change NA valu

Re: [R] bootstrap resampling question

2011-03-02 Thread Giovanni Petris
Good point. I'll take my suggestion back... Giovanni On Tue, 2011-03-01 at 13:18 -0500, Jonathan P Daily wrote: > I'm not sure that is equivalent to sampling with replacement, since if the > first "draw" is 1, then the probability that the next draw will be one is > 4/100 instead of the 1/20 it

[R] Refine ARMA model

2011-03-02 Thread Chuse chuse
Dear users, I tried to fit an AR(2) model to data. This the result: > arima(vw,c(3,0,0)) Call: arima(x = vw, order = c(3, 0, 0)) Coefficients: ar1 ar2 ar3 intercept 0.1052 -0.0102 -0.1203 0.0099 s.e. 0.0337 0.0339 0.0338 0.0018 sigma^2 estimated as 0.002

Re: [R] what does the "S.D." returned by {Hmisc} rcorr.cens measure?

2011-03-02 Thread Frank Harrell
Dxy is a U-statistic. In the U-statistic literature there is a combinatoric approach to estimating variances, requiring one to examine all possible pairs of observations. The general formula I use is a bit messy. You can look at the Fortran code that comes with the Hmisc package to see the algor

Re: [R] R and Android

2011-03-02 Thread Ben Ward
Is there really one for the iphone? As far as I was aware, apple had beef about their policy agreements and the fact such software is open source/free as in freedom. I actually expected the situation would be the other way round: console for android but none for iphone? Ben W. On 02/03/2011 1

Re: [R] Rcommander

2011-03-02 Thread John Fox
Dear Selda, Most likely you haven't installed Tcl/Tk for X-windows. If you haven't already done so, please see the Rcmdr installation instructions for Mac users at . I hope this helps, John --

Re: [R] a question on sqldf's handling of missing value and factor

2011-03-02 Thread Gabor Grothendieck
On Tue, Mar 1, 2011 at 11:52 PM, xin wei wrote: > Dear subscribers: > > I am using the following code to read a large number of big text files: > library(sqldf) > tempd <- file() > tempdx <- sqldf("select * from tempd", dbname = tempfile(), file.format = > list(header = T, sep="\t", row.names

  1   2   >