[R] typecasting a function from character to double

2011-02-28 Thread LucasM
Hello, I try to plot a number of functions that are given by a textfile. This file looks like this: (1+s) / (1+k) ; (1+(2*s)^2) / (1+k)^2 ; etc etc. I import these functions into R with the 'readLines' command. This creates a table whose elements contain the conditions as character

Re: [R] Measuring correlations in repeated measures data

2011-02-28 Thread Ben Bolker
Brant Inman brant.inman at mac.com writes: R-helpers: I would like to measure the correlation coefficient between the repeated measures of a single variable that is measured over time and is unbalanced. As an example, consider the Orthodont dataset from package nlme, where the model is:

Re: [R] R help

2011-02-28 Thread Jim Lemon
On 02/28/2011 02:37 PM, Laura Clasemann wrote: Hi, I was wondering if anyone could provide me with help in entering the attached dataset into R? I've been having a hard time in trying to figure out how to assemble it into both a frequency table and a bar graph within R. I've been trying to

Re: [R] typecasting a function from character to double

2011-02-28 Thread Phil Spector
What you're are describing in a vector of character strings containing expressions. It doesn't make sense to try to coerce them to double without evaluating them. I'm not completely clear on your intent, but this example may point you to where you'd need to look to do what you want: exprs =

[R] R: Adjusting for autocorrelation in a panel model

2011-02-28 Thread Millo Giovanni
Dear David, thank you for the good words. As for the FE+MA(4) model, I don't know: I must admit, the RE example was chosen on purpose. The concepts of 'fixed' and 'random' effects are, as you have learnt, quite different between the standard econometric vs. mixed models parlance, so the

[R] Fwd: Re: speed up process

2011-02-28 Thread Ivan Calandra
Dear Jim, Here is again exactly what I did and with the output of Rprof (with this reduced dataset and with a simpler function, it is here much faster than in real life). Thanks you again for your help! ## CODE ## mydata1- structure(list(species = structure(1:8, .Label = c(alsen,gogor,

[R] regularized discriminant function analysis using klaR: problems with predictions

2011-02-28 Thread Daniel Stahl
Sorry, I forgot to mention that I used the package klaR. Dear all, I am trying to do a n-fold cross-validation for a regularized discrimant function analysis using rda from the package klaR. However, I have problems to predict the groups from the test/validation sample. The exmaples

[R] r help for growth rate

2011-02-28 Thread Muzna Alvi
I'm havinf a problem with a simple file i have the following data State 1960 1970 1980 1990 1 All India 35988.70 37346.00 39707.30 42321.00 2Andhra Pradesh 3431.03 3163.27 3687.23 3695.63 3 Assam 1902.93 2001.60 2278.47 2525.33 4 Bihar 5277.07

Re: [R] Database abstraction

2011-02-28 Thread Rob Paul Tirrell
I was also wondering about precedents or similar packages in the R ecosytem. I'm familiar with R-ORM and SQLDF, which seem closest. At this point any and all feedback and critiques are extremely welcome! I imagine other frequent database users have had problems much the same as mine. I'd like

Re: [R] Substituting inside expression

2011-02-28 Thread zbynek.jano...@gmail.com
Thanks, but it is not exactly what i wanted to achieve. I need to calculate a derivation of this complex formula and I don´t think this would enable me to do so. But luckily, I have manages to built a by-pass, so this is not necessary anymore zbynek -- View this message in context:

[R] R5 multiple inheritance

2011-02-28 Thread Rob Paul Tirrell
Hi all - Is anyone aware of any solutions (or workarounds) for R5 classes that allow multiple inheritance? Alternatively, if anyone has ideas about how where I may be able to start, I'm willing to delve into dark magic. It's presently possible to give multiple superclasses in contains, but

[R] Incorrectness of mean()

2011-02-28 Thread zbynek.jano...@gmail.com
I have found following problem: I have a vector: a - c(1.04,1.04,1.05,1.04,1.04) I want a mean of this vector: mean(a) [1] 1.042 which is correct, but: mean(1.04,1.04,1.05,1.04,1.04) [1] 1.04 gives an incorrect value. how is this possible? thanks, zbynek -- View this message in context:

Re: [R] Substituting inside expression

2011-02-28 Thread zbynek.jano...@gmail.com
Thanks, Your advice solved the problem for one substitution, but I needed to substitute twice: first s = (a+b+c)/2 and than c = sqrt(a^2 + b^2 -2*a*b*cos(gamma)) and I hoped I can do it simultaneously Luckily, I managed to go round the problem and this operation is not necessary anymore:) Thanks

Re: [R] r help for growth rate

2011-02-28 Thread Jim Lemon
On 02/28/2011 07:49 PM, Muzna Alvi wrote: I'm havinf a problem with a simple file i have the following data State 1960 1970 1980 1990 1 All India 35988.70 37346.00 39707.30 42321.00 2Andhra Pradesh 3431.03 3163.27 3687.23 3695.63 3 Assam 1902.93 2001.60

Re: [R] Incorrectness of mean()

2011-02-28 Thread Jim Lemon
On 02/28/2011 09:07 PM, zbynek.jano...@gmail.com wrote: I have found following problem: I have a vector: a- c(1.04,1.04,1.05,1.04,1.04) I want a mean of this vector: mean(a) [1] 1.042 which is correct, but: mean(1.04,1.04,1.05,1.04,1.04) [1] 1.04 gives an incorrect value. how is this

Re: [R] Kolmogorov-smirnov test

2011-02-28 Thread Glen Barnett
It's designed for continuous distributions. See the first sentence here: http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test K-S is conservative on discrete distributions On Sat, Feb 19, 2011 at 1:52 PM, tsippel tsip...@gmail.com wrote: Is the kolmogorov-smirnov test valid on both

Re: [R] Incorrectness of mean()

2011-02-28 Thread Claudia Beleites
On 02/28/2011 11:07 AM, zbynek.jano...@gmail.com wrote: I have found following problem: I have a vector: a- c(1.04,1.04,1.05,1.04,1.04) I want a mean of this vector: mean(a) [1] 1.042 which is correct, but: mean(1.04,1.04,1.05,1.04,1.04) [1] 1.04 gives an incorrect value. how is this

Re: [R] Incorrectness of mean()

2011-02-28 Thread zbynek.jano...@gmail.com
Oh, I see it now. I guess it confused me, when it did not give me warning and also the numbers were very much alike, so I expected wrong decimal places thanks zbynek -- View this message in context: http://r.789695.n4.nabble.com/Incorrectness-of-mean-tp3327701p3327714.html Sent from the R help

[R] changing origin and plotting complex graphs

2011-02-28 Thread Muzna Alvi
I have data on area under cultivation of a crops for 17 states..I need a scatter plot to be made for the following assignment Read the data file /Data/ep602/areas.csv, and make a scatter plot that displays area under rice in 1960s on the x axis, and percentage change in area under rice between

Re: [R] Incorrectness of mean()

2011-02-28 Thread Rob Tirrell
Keep your eyes out for this - you will find this sort of behavior throughout R. -- Robert Tirrell | r...@stanford.edu | (607) 437-6532 Program in Biomedical Informatics | Butte Lab | Stanford University On Mon, Feb 28, 2011 at 02:26, zbynek.jano...@gmail.com zbynek.jano...@centrum.cz wrote:

Re: [R] typecasting a function from character to double

2011-02-28 Thread LucasM
Dear Phil, The sapply statement made it work. The function indeed needed evaluation before plotting. Many thanks for the useful hint! Lucas -- View this message in context: http://r.789695.n4.nabble.com/typecasting-a-function-from-character-to-double-tp3327555p3327755.html Sent from the R

[R] legend: height of entries

2011-02-28 Thread Stefan Richter
Hello, i have a plot with a horizontal legend, and the legend entries are like: c(A,B,ABCABCABC,D) Then all entries in the legend get the width of ABCABCABC. Is there a possibility to change this so that all entries get only the width they need? Thank you! Stefan Richter

Re: [R] legend: height of entries

2011-02-28 Thread Sarah Goslee
Stefan, I'm not entirely certain what you're doing. Providing a working example would make it much easier for us to offer suggestions. The graphics system you're using matters, for instance. Sarah On Mon, Feb 28, 2011 at 6:32 AM, Stefan Richter stefan.sta...@web.de wrote: Hello, i have a

[R] Creating new variables. How do you get them into a data frame?

2011-02-28 Thread Nick Riches
Hi I'm an R newbie. I can't seem to add new variables to data frames. Here are the stages (1) I import the data using read.csv. (2) I fix it using fix(data) (3) I create a new variable using spos-tagPOS(stim,language=en,model=NULL,tagdict=NULL). (tagPOS is a function in the OpenNLP toolkit,

Re: [R] Creating new variables. How do you get them into a data frame?

2011-02-28 Thread Sarah Goslee
Hi Nick, You want: cbind(mydataframe, newvar) and possibly also a quick read of one of the intro to R documents available online. Sarah On Mon, Feb 28, 2011 at 6:55 AM, Nick Riches nick.ric...@gmail.com wrote: Hi I'm an R newbie. I can't seem to add new variables to data frames. Here are

Re: [R] Hello!

2011-02-28 Thread Mike Marchywka
Date: Sun, 27 Feb 2011 14:31:57 -0800 [[elided Hotmail spam]] From: jwiley.ps...@gmail.com To: marchy...@hotmail.com CC: r-help@r-project.org On Sun, Feb 27, 2011 at 9:16 AM, Mike Marchywka wrote: I can probably find more negative ones if

Re: [R] legend: height of entries

2011-02-28 Thread Stefan Richter
Hello, Am 28.02.2011 um 12:57 schrieb Sarah Goslee: Stefan, I'm not entirely certain what you're doing. Providing a working example would make it much easier for us to offer suggestions. The graphics system you're using matters, for instance. Sarah Thank you for your replay, Sarah! I

Re: [R] Creating new variables. How do you get them into a data frame?

2011-02-28 Thread Nick Riches
Many thanks for the info Nick Riches On 28 February 2011 12:05, Sarah Goslee sarah.gos...@gmail.com wrote: Hi Nick, You want: cbind(mydataframe, newvar) and possibly also a quick read of one of the intro to R documents available online. Sarah On Mon, Feb 28, 2011 at 6:55 AM, Nick

[R] stuk at another point: simple question

2011-02-28 Thread Umesh Rosyara
Dear R-community members. I am really appreciate R-help group. Dennis has been extrremely helpful to solve some of my questions. I am following Dennis recommendation in the following email, yet I am stuck at another point (hope this will took me to end of this project. Ind - c(1:5) Parent1 -

[R] Replacing an element in a vector

2011-02-28 Thread Vincy Pyne
Dear R helpers I seem to have one trivial problem but can't find solution to it. Suppose I have following input. A = c(1,  3,  0,  5,  8)  # 3rd element is 0 B = c(100, 30,  0,  25,  40)  # 3rd element is 0 C = A/B C [1] 0.01 0.10  NaN 0.20 0.20 Obviously, I can't

Re: [R] Kolmogorov-smirnov test

2011-02-28 Thread Jay Emerson
Taylor Arnold and I have developed a package ks.test (available on R-Forge in beta version) that modifies stats::ks.test to handle discrete null distributions for one-sample tests. We also have a draft of a paper we could provide (email us). The package uses methodology of Conover (1972) and

Re: [R] Replacing an element in a vector

2011-02-28 Thread Ivan Calandra
Dear Vincy, Try this: C[is.nan(C)] - 0 HTH, Ivan Le 2/28/2011 13:10, Vincy Pyne a écrit : Dear R helpers I seem to have one trivial problem but can't find solution to it. Suppose I have following input. A = c(1, 3, 0, 5, 8) # 3rd element is 0 B = c(100, 30, 0, 25,

[R] re-arranging data to create an image (or heatmap)

2011-02-28 Thread pierz
Let me start by introducing myself as a biologist with only a little knowledge about programming in matlab and R. In the past I have succesfully created my figures in matlab using the hist3d command, but I have not access to matlab right now and would like to switch to R. I have used the plot

[R] mixture models/latent class regression comparison

2011-02-28 Thread Carson Farmer
Dear list, I have been comparing the outputs of two packages for latent class regression, namely 'flexmix', and 'mmlcr'. What I have noticed is that the flexmix package appears to come up with a much better fit than the mmlcr package (based on logLik, AIC, BIC, and visual inspection). Has anyone

Re: [R] re-arranging data to create an image (or heatmap)

2011-02-28 Thread Claudia Beleites
Pierz, - easy approximation: use coulours with alpha value for plotting points x - runif (1000) y - runif (1000) * x + x plot (x, y) plot (x, y, pch = 20, col = #FF20) - more sophisticated: have a look at hexbin (package hexbin), levelplot (package lattice), package ggplot2 with

Re: [R] Substituting inside expression

2011-02-28 Thread Gabor Grothendieck
On Mon, Feb 28, 2011 at 5:03 AM, zbynek.jano...@gmail.com zbynek.jano...@centrum.cz wrote: Thanks, Your advice solved the problem for one substitution, but I needed to substitute twice: first s = (a+b+c)/2 and than c = sqrt(a^2 + b^2 -2*a*b*cos(gamma)) and I hoped I can do it simultaneously

Re: [R] Discrepancies in run times

2011-02-28 Thread Sébastien Bihorel
Hi, After dozens of hours of testing, I have managed to prevent those run time differences by set save.object in lattice.options to FALSE. I'm still not sure how this option impacts my functions but setting it to FALSE definitively solved the problem. Sebastien On Tue, Feb 22, 2011 at 1:20 PM,

Re: [R] nested case-control study

2011-02-28 Thread Terry Therneau
Hi, I am wondering if there is a package for doing conditional logistic regression for nested case-control study as described in Estimation of absolute risk from nested case-control data by Langholz and Borgan (1997) where Horvitz-Thompson sampling weight (log of (number in the risk set

[R] help

2011-02-28 Thread Laura Clasemann
Hi, I was wondering if anyone could provide me with help in entering the dataset below into R? I've been having a hard time in trying to figure out how to assemble it into both a frequency table and a bar graph within R. I've been trying to present the way I had the data arranged, as

Re: [R] help

2011-02-28 Thread Steve Lianoglou
Hi, It's hard (for me) to parse how the data you listed below is meant to be structured. There's a rather large document explaining different methods of import/exporting data to/from R: http://cran.r-project.org/doc/manuals/R-data.pdf In short, though, if your data well structured in excel,

Re: [R] Trouble using duleg from labdsv

2011-02-28 Thread hhbruun
Hi Michelle, I experience exactly the same annoying problem. Have you come to a solution since you posted your request for help? Hans H. -- View this message in context: http://r.789695.n4.nabble.com/Trouble-using-duleg-from-labdsv-tp3306061p3328123.html Sent from the R help mailing list

[R] Problems using unique function and !duplicated

2011-02-28 Thread JonC
Hi, I am trying to simultaneously remove duplicate variables from two or more variables in a small R data.frame. I am trying to reproduce the SAS statements from a Proc Sort with Nodupkey for those familiar with SAS. Here's my example data : test - read.csv(test.csv, sep=,, as.is=TRUE) test

Re: [R] Trouble using duleg from labdsv

2011-02-28 Thread hhbruun
Hi again, It seems the problem can be solved by using the new package indicspecies, function multipatt (setting duleg=T). Good luck Hans H. -- View this message in context: http://r.789695.n4.nabble.com/Trouble-using-duleg-from-labdsv-tp3306061p3328167.html Sent from the R help mailing list

Re: [R] Problems using unique function and !duplicated

2011-02-28 Thread Ivan Calandra
Hi Jon, I think you made a mistake in your desired output. If it is indeed a mistake, then this should do: test[!duplicated(test[,c(date,var2)]),] HTH, Ivan PS: think about dput() when you want to share objects, in this case dput(test) Le 2/28/2011 16:51, JonC a écrit : Hi, I am trying

Re: [R] Problems using unique function and !duplicated

2011-02-28 Thread Claudia Beleites
Jon, you need to combine the conditions into one logical value, e.g. cond1 cond2, e.g. !duplicated(test$date) !duplicated(test$var2) However, I doubt that this is what you want: you remove too many rows (rows whose single values appeared already, even if the combination is unique). Have

Re: [R] mixture models/latent class regression comparison

2011-02-28 Thread Christian Hennig
Dear Carson, I have never used mmlcr for this, but quite generally when fitting such models, the likelihood has often very many local optima. This means that the result of the EM (or a similar) algorithm depends on the initialisation, which in flexmix (and perhaps also in mmlcr) is done in a

Re: [R] Problems using unique function and !duplicated

2011-02-28 Thread Ted Harding
On 28-Feb-11 15:51:17, JonC wrote: Hi, I am trying to simultaneously remove duplicate variables from two or more variables in a small R data.frame. I am trying to reproduce the SAS statements from a Proc Sort with Nodupkey for those familiar with SAS. Here's my example data : test -

Re: [R] re-arranging data to create an image (or heatmap)

2011-02-28 Thread pierz
Thank you for your quick reply. The change in transparency makes a big difference. I will have a look at the other packages to see if i can do multiple colors. -- View this message in context: http://r.789695.n4.nabble.com/re-arranging-data-to-create-an-image-or-heatmap-tp3327986p3328227.html

[R] problem with ROCR

2011-02-28 Thread Matteo Pettinari
Dear R team I have a problem with the installation of the RCOR package; any time I try to install it I get the error message: Error: package 'ROCR' was built before R 2.10.0: please re-install it. What can I do to solve this problem? Thank you Kind regards Dr. Matteo Pettinari Senior

[R] lme error: Error in getGroups.data.frame(dataMix, groups)

2011-02-28 Thread John Sorkin
R 2.10.0 Windows XP I am trying to run lme. I receive the following error message: My lme code is: fitRandom - lme(values ~ factor(subject), data=withindata) Below I have printed the console output, and at the bottom of this message, I have printed my code. I hope someone can tell my what I

[R] converting the string columns in a data.frame to factors?

2011-02-28 Thread John Edwards
Dear All, I'm not sure if I understand the parameter stringsAsFactors correctly. I'm trying to convert the string columns in aframe1 to factors. But it seems stringsAsFactors=T in as.data.frame() doesn't do anything. Could anybody let know what is the correct way to converting strings to factors?

Re: [R] converting the string columns in a data.frame to factors?

2011-02-28 Thread Ivan Calandra
Hi John, Use factor(): aframe2$x - factor(aframe2$x) Or, for all columns at once (there might be an easier solution): aframe2 - as.data.frame(lapply(aframe1, factor)) see ?factor HTH, Ivan Le 2/28/2011 18:13, John Edwards a écrit : Dear All, I'm not sure if I understand the parameter

Re: [R] converting the string columns in a data.frame to factors?

2011-02-28 Thread Erik Iverson
John, as.data.frame is a generic function that will call different methods depending on what class of object you pass to it. The different methods may have different arguments that they expect or honor. The stringsAsFactors parameter is only used in certain methods of as.data.frame. When you

Re: [R] regularized dfa rda (Klar): problems with predictions

2011-02-28 Thread Uwe Ligges
On 27.02.2011 22:59, Daniel Stahl wrote: Dear all, I am trying to do a n-fold cross-validation for a regularized discrimant function analysis using rda from the package klaR. However, I have problems to predict the groups from the test/validation sample. The exmaples of the R documantation

Re: [R] problem with ROCR

2011-02-28 Thread Uwe Ligges
As said on CRAN@ before: Run update.packages(checkBuilt=TRUE) and try again. Uwe Ligges On 28.02.2011 17:20, Matteo Pettinari wrote: Dear R team I have a problem with the installation of the RCOR package; any time I try to install it I get the error message: Error: package 'ROCR' was

Re: [R] changing origin and plotting complex graphs

2011-02-28 Thread Jannis
Hi Muzna, how about you getting first familiar with the basics of R? Have a look at the manuals on the CRAN webpage (http://cran.r-project.org/) or get an introductive textbook. Your questions are very basic so it will not be too hard for you to get started. In case you get stuck with a

[R] dot chart adding group labels....HELP

2011-02-28 Thread David Lyon
HI everyone Does anayone know how to add group labels to dot charts From the R code below a-read.table(test2, sep=\t, header=TRUE) dotchart(as.matrix(t()), main=test) it generates from the datafile input below, file test2 containing: A B C D E 1 1 1

[R] FW: help

2011-02-28 Thread Laura Clasemann
Hi, I apologize for sending this again but realized that the data I had originally sent in my first email did not show correctly and wanted to send it again to give a better idea of how I am trying to show my data within R. Thanks! Laura Diet: Binger-yes:

[R] plotting, graph, everything

2011-02-28 Thread Muzna Alvi
I have this assignment to do and after ten hours of constant trying my eyes ache and i give up.. all i'm able to get is this plot please help me these are the commands i have used till now read.table(file.choose(), sep=;, header=T) read.table(file.choose(), sep=;, header=T)-areas

Re: [R] help

2011-02-28 Thread rex.dwyer
Generally, you can save your excel spreadsheet as comma-separated values, and then read with read.csv function: ?read.csv Or, tab-separated values and use read.delim. Then look at ?barplot Possibly you would like to read the Intro to R on the CRAN website. Go to www.r-project.org , find

[R] R quadreg

2011-02-28 Thread knut-o
Hi I have a x-list and a y-list and I'm trying to make a line that goes ca. through the dots. I want to find a, b and c in ax^2 + bx + c. How to do? Thanks, Knut -- View this message in context: http://r.789695.n4.nabble.com/R-quadreg-tp3328275p3328275.html Sent from the R help mailing list

Re: [R] Error

2011-02-28 Thread rex.dwyer
I have to agree that it's pretty hard to take something that works and figure out why it doesn't work :) The only other suggestion is that sometimes I find that this sort of error goes away if I add drop=FALSE to the subsetting, and, if so, that usually lets me figure out why. -Original

[R] [R-pkgs] ascii package updated

2011-02-28 Thread David Hajage
Hi, I have uploaded a new version of the ascii package, it should be availble on CRAN soon. Major new features are: - pandoc support (http://johnmacfarlane.net/pandoc/) - an alternative to the Sweave way to create reports: see ?Report. This feature needs a working installation of asciidoc,

Re: [R] Finding pairs with least magnitude difference from mean

2011-02-28 Thread rex.dwyer
James, It seems the 2*mean(x) term is irrelevant if you are seeking to minimize sd. Then you want to sort the distances from smallest to largest. Then it seems clear that your five values will be adjacent in the list, since if you have a set of five adjacent values, exchanging any of them for

[R] plot data frame

2011-02-28 Thread Chuse chuse
Dear R user, How can i plot this data as one time series - notice that it is not column wise. V1V2 V3 V4 V5 V6 V7 [1,] 1950.01 1.07 1.12 1.12 1.25 1.16 1.15 [2,] 1950.07 1.16 1.20 1.30 1.31 1.36 1.34 [3,] 1951.01 1.34 1.36 1.40 1.47 1.55 1.45 [4,] 1951.07 1.56 1.62

Re: [R] re-arranging data to create an image (or heatmap)

2011-02-28 Thread Mike Marchywka
ok, third try. This is a repost of a message never made it past mod as I cancelled while it was waiting to clean up some code to at least make it close to working. I think this does more or less what you want, library(VecStatGraphs2D) DrawDensityMap(x1,x2,PaintPoint=TRUE) but if not see

[R] A new IDE for R: RStudio

2011-02-28 Thread johannes rara
Hi, This is not an official announcement, I just discovered that a new IDE for R named RStudio was released today. Looks very very promising to me! http://www.rstudio.org -J __ R-help@r-project.org mailing list

Re: [R] Error

2011-02-28 Thread William Dunlap
You can debug this sort of thing yourself by altering your function to tell you what its inputs are when things go wrong. E.g., change your original foo - function(x) { unlist(lapply(x, FUN = function(z) cumsum(z) - z)) } to foo - function(x) { retval - unlist(lapply(x,

Re: [R] Finding pairs with least magnitude difference from mean

2011-02-28 Thread Hans W Borchers
rex.dwyer at syngenta.com writes: James, It seems the 2*mean(x) term is irrelevant if you are seeking to minimize sd. Then you want to sort the distances from smallest to largest. Then it seems clear that your five values will be adjacent in the list, since if you have a set of five

[R] sub setting data.frame

2011-02-28 Thread Nicolas Gutierrez
Hi All, I have a data.frame: pop consumed ind recruits gonad cell 1516.74 1 0.0220.21 0.25 2 1143.20 1 0.0220.21 0.50 3250.00 1 0.0220.21 0.25 4251.98 1 0.0218.69 0.25 5598.08 1 0.0218.69 0.25 6437.38 1 0.02

[R] lme error message: Error in getGroups.data.frame(dataMix, groups) :

2011-02-28 Thread John Sorkin
Windows XP R 2.10 I am trying to run lme and get the following error: fitRandom - lme(values ~ subject, + data=withindata) Error in getGroups.data.frame(dataMix, groups) : Invalid formula for groups my data follows, below which is a copy of all my code print(withindata) subject

Re: [R] sub setting data.frame

2011-02-28 Thread Ista Zahn
I don't understand the question... On Mon, Feb 28, 2011 at 2:46 PM, Nicolas Gutierrez nicol...@uw.edu wrote: Hi All, I have a data.frame: pop    consumed ind recruits   gonad cell 1    516.74   1     0.02    20.21 0.25 2   1143.20   1     0.02    20.21 0.50 3    250.00   1     0.02    

Re: [R] sub setting data.frame

2011-02-28 Thread Nicolas Gutierrez
Got it.. thanks to Jorge! pop[1:which(with(pop, cumsum(cell) == 2)),] Nico 2/28/2011 12:08 PM, Ista Zahn wrote: I don't understand the question... On Mon, Feb 28, 2011 at 2:46 PM, Nicolas Gutierreznicol...@uw.edu wrote: Hi All, I have a data.frame: pop consumed ind recruits

Re: [R] dot chart adding group labels....HELP

2011-02-28 Thread Jannis
No idea what this dotchart is actually meant to visualize but naming the columns of the data matrix gives you names for your groups which are also used to label the plot. ?dimnames ?colnames HTH Jannis On 02/28/2011 06:13 PM, David Lyon wrote: HI everyone Does anayone know how to add

[R] MultiDimensional arrays

2011-02-28 Thread Steve_Friedman
hello, I'm working with a 4 dimensional NetCDF file, trying to calculate some summary statistics on a parameter. The dimensions are number of rows and columns, time and days. The attribute in question in this case happens to be a probability of woodstork foraging success. But it could be

Re: [R] Reproducibility issue in gbm (32 vs 64 bit)

2011-02-28 Thread Guelman, Leo
I'm guessing this has something to do with numerical precision on the two platforms. Leo. - Original Message - From: Joshua Wiley jwiley.ps...@gmail.com To: Axel Urbiz axel.ur...@gmail.com Cc: R-help@r-project.org R-help@r-project.org; Ridgeway, Greg Sent: Fri Feb 25 22:16:02 2011

Re: [R] R quadreg

2011-02-28 Thread Petr Savicky
On Mon, Feb 28, 2011 at 08:41:02AM -0800, knut-o wrote: Hi I have a x-list and a y-list and I'm trying to make a line that goes ca. through the dots. I want to find a, b and c in ax^2 + bx + c. How to do? Hi. Try the following x - rnorm(100) y - 4*x^2 + 3*x + 2 + 0.2*rnorm(100) z -

Re: [R] plot data frame

2011-02-28 Thread Jannis
I would transfer your matrix to a vector.assuming that your dataset is called data.matrix: as.vector(t(data.matrix[,-1])) should give you what you want... HTH Jannis On 02/28/2011 07:19 PM, Chuse chuse wrote: Dear R user, How can i plot this data as one time series - notice that it

[R] Data type problem when extract data from SQLite to R by using RSQLite

2011-02-28 Thread chen jia
Hi there, When I extract data from SQLite to R, the data types (or modes) of the extracted data seems to be determined by the value of the first row. Please see the following example. When I put the missing values first, the column extracted is of the mode character.

Re: [R] plotting, graph, everything

2011-02-28 Thread Jannis
Hey Muzna, similar answer as to your other post. The R-list is not supposed to make your homework for you (see posting guide). You should better discuss this with the person who made the assignment. We will help you when you have concrete questions. Jannis On 02/28/2011 05:25 PM, Muzna

Re: [R] Interactive/Dynamic plots with R

2011-02-28 Thread Abhishek Pratap
Thanks Greg for all the suggestions. -Abhi On Sat, Feb 26, 2011 at 2:07 PM, Tal Galili tal.gal...@gmail.com wrote: Hello Abhishek, Also notice that if you are on windows, then rggobi doesn't work for the latest R (with ggobi 2.1.8) because of GTK/dll issues.  In such a case, Greg's other

[R] nls help

2011-02-28 Thread Schatzi
I am running the following nls equation. I tried it with data that excel was fitting and got the error: singular gradient matrix at initial parameter estimates I thought it was due to a low number of points (6), but when I create a dataset, I get the same problem. If I remove the parameter a,

[R] power of the comparison of two ROC curves

2011-02-28 Thread Alexandra Romann
Hello, I would like to find the power of the comparison of two ROC curves (paired data). Is there an R function that does this? Thank you, Alexandra [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Measuring correlations in repeated measures data

2011-02-28 Thread Brant Inman
Ben, Thanks for the response. Your method generates an answer that is slightly different than what I was looking for. In the Orthodont dataset there are 4 age groups (8, 10, 12, 14). I would like to calculate the correlation of distance for all combinations of the categorical variable age.

[R] nls

2011-02-28 Thread Schatzi
I am running the following nls equation. I tried it with data that excel was fitting and got the error: singular gradient matrix at initial parameter estimates I thought it was due to a low number of points (6), but when I create a dataset, I get the same problem. If I remove the parameter a,

Re: [R] nls help

2011-02-28 Thread Schatzi
If no one is able to help with this issue, do you have any idea where I can post this question to receive help? Thank you. -- View this message in context: http://r.789695.n4.nabble.com/nls-help-tp3328521p3328611.html Sent from the R help mailing list archive at Nabble.com.

[R] nls not solving

2011-02-28 Thread Schatzi
I am running the following nls equation. I tried it with data that excel was fitting and got the error: singular gradient matrix at initial parameter estimates I thought it was due to a low number of points (6), but when I create a dataset, I get the same problem. If I remove the parameter a,

Re: [R] nls not solving

2011-02-28 Thread Schatzi
By the way, sorry about the reposts. I subscribed but wasn't sure what was happening. Hopefully this worked. -- View this message in context: http://r.789695.n4.nabble.com/nls-not-solving-tp3328647p3328659.html Sent from the R help mailing list archive at Nabble.com.

[R] Regression with many independent variables

2011-02-28 Thread Matthew Douglas
Hi, I am trying use lm() on some data, the code works fine but I would like to use a more efficient way to do this. The data looks like this (the data is very sparse with a few 1s, -1s and the rest 0s): head(adj0708) MARGIN Poss P235 P247 P703 P218 P430 P489 P83 P307 P337 1

[R] mlogit.data

2011-02-28 Thread Gregory Macfarlane
I am trying to estimate multinomial logit models off of a .csv table in IDCASE IDALT format where I have ROWS HHID PERID CASE ALTNUM NUMALTS CHOSEN IVTT OVTT TVTT COST DIST WKZONE HMZONE RSPOPDEN RSEMPDEN WKPOPDEN 1 12 11 1 5 1 13.38 2.00 15.38 70.63

Re: [R] lme error: Error in getGroups.data.frame(dataMix, groups)

2011-02-28 Thread Dennis Murphy
Hi: On Mon, Feb 28, 2011 at 8:42 AM, John Sorkin jsor...@grecc.umaryland.eduwrote: R 2.10.0 Windows XP I am trying to run lme. I receive the following error message: My lme code is: fitRandom - lme(values ~ factor(subject), data=withindata) Where's the random factor? Perhaps you mean

Re: [R] dot chart adding group labels....HELP

2011-02-28 Thread Peter Ehlers
On 2011-02-28 12:31, Jannis wrote: No idea what this dotchart is actually meant to visualize but naming the columns of the data matrix gives you names for your groups which are also used to label the plot. ?dimnames ?colnames HTH Jannis I think that David might need to assign row names. @

Re: [R] Regression with many independent variables

2011-02-28 Thread Greg Snow
Don't put the name of the dataset in the formula, use the data argument to lm to provide that. A single period (.) on the right hand side of the formula will represent all the columns in the data set that are not on the left hand side (you can then use - to remove any other columns that you

Re: [R] neural networks with RSNNS

2011-02-28 Thread Sara Szeremeta
OK, I think I know what is the answer to this question - first I have to define a rsnns object factory, create a network (specify its architecture) and only THEN I can use train (this is what I have understood from the RSNNS manual) However, for the sake of not being stuck with this one, I used

Re: [R] nls not solving

2011-02-28 Thread Bert Gunter
Well, since no one else has replied, let me state the obvious: The model is nonidentifiable. It is of the form: y = a + b(1 - exp(kl)) - b exp(-kx) Suppose you have a solution. Suppose with your solution, a + b(1 -exp(kl)) = C, say. Then a = C - b(1-exp(kl)). Hence you have generated an

Re: [R] R quadreg

2011-02-28 Thread knut-o
Thank you for saving my day! Googled around but diden't find anything useful. This worked :-) -- View this message in context: http://r.789695.n4.nabble.com/R-quadreg-tp3328275p3328724.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] mlogit error

2011-02-28 Thread gmacfarlane
I actually have exactly the same question as Maha, and I wish that Z had answered the question instead of providing a lesson in streamlined code (valuable, but not helpful). It seems as though mlogit.data repopulates the row.names field, and that this is where the duplication comes in.

Re: [R] mlogit error

2011-02-28 Thread Peter Ehlers
On 2011-02-28 12:54, gmacfarlane wrote: I actually have exactly the same question as Maha, and I wish that Z had answered the question instead of providing a lesson in streamlined code (valuable, but not helpful). I think that Achim answered as best one could, given that Maha neglected, as you

[R] Gamma mixture models with flexmix

2011-02-28 Thread Wittner, Ben, Ph.D.
I've been trying with no success to model mixtures of Gamma distributions using the package flexmix (see examples below). Can anyone help me get it to model better? Thanks very much. -Ben ## ## Please help me get flexmix to correctly model mixtures of ## Gamma distributions. See examples

Re: [R] mlogit.data

2011-02-28 Thread Mark Difford
On Feb 28, 2011; 10:33pm Gregory Macfarlane wrote: It seems as though the mlogit.data command tries to reassign my row.names, and doesn't do it right. Is this accurate? How do I move forward? Take the time to do as the posting guide asks you to do (and maybe consider the possibility that you

  1   2   >