Re: [R] Where is gdata?

2010-11-29 Thread Stephen Liu
Hi Liviu, Not if you library(gdata) first. Then ?read.xls should work. Yes, I did. I found something strange here which I can't explain. Win 7 64bit R 32/64 bit Just rebooted Win 7 and R library(gdata) gdata: Unable to locate valid perl interpreter gdata: gdata: read.xls() will be

[R] Help Please!!!!!!!!!

2010-11-29 Thread Melissa Waldman
Hi, I have been working with Program R for my stats class and I keep coming upon the same error, I have read so many sites about inputting data from a text file into R and I'm using the data to do a correspondence analysis. I feel like I have read everything and it is still not explaining why

[R] Evaluation of survival analysis

2010-11-29 Thread He Zhang
Dear all, May I ask is there any functions in R to evaluate the fitness of coxph and survreg in survival analysis, please? For example, the results from Cox regression and Parametric survival analysis are shown below. Which method is prefered and how to see that / how to compare the methods? 1.

Re: [R] Where is gdata?

2010-11-29 Thread Spencer Graves
Hi, Stephen: The directory C:\Users\satimiswin764\My Documents\R\win-library\2.12\gdata\perl is NOT the perl interpreter but only perl code in the gdata package for R, invoked by certain R commands. You need to install something like Strawberry perl, as I've previously stated.

Re: [R] Help Please!!!!!!!!!

2010-11-29 Thread Edwin Groot
On Sun, 28 Nov 2010 21:29:08 -0800 Melissa Waldman melissawald...@gmail.com wrote: Hi, I have been working with Program R for my stats class and I keep coming upon the same error, I have read so many sites about inputting data from a text file into R and I'm using the data to do a

[R] cross tabulate variables by subject id

2010-11-29 Thread Marianne Promberger
Dear list, I have data like this: dat1 - data.frame(subject=rep(1:10,2), cond1=rep(c(A,B),each=5), cond2=rep(c(C,D),each=10), choice=sample(0:1,10,replace=TRUE)) I would like to compare subjects' choice for (cond1==A cond2==C) vs

Re: [R] Help Please!!!!!!!!!

2010-11-29 Thread Paul
On 29/11/10 05:29, Melissa Waldman wrote: Hi, I have been working with Program R for my stats class and I keep coming upon the same error, I have read so many sites about inputting data from a text file into R and I'm using the data to do a correspondence analysis. I feel like I have read

[R] Bayes factor for a Welch or Yuen t-test

2010-11-29 Thread Wilson, Andrew
Although I have located a number of solutions for the Student t-test (equal variances), I have been unable to find any code for calculating a Bayes Factor for a Welch (unequal variances) or Yuen (trimmed mean) t-test. I wonder if anyone could help me with this? Many thanks, Andrew Wilson

[R] RODBC read all columns as character

2010-11-29 Thread juerg.dietrich
I'm using sqlQuery() to import excel-data (.xlsx). Almost everthing works perfect. But a column which contains type numeric as well as character is read as numeric. characters are unfortunately transformed to NA. How can I read all columns as characters? I've allready tried 'as.is=TRUE'.

Re: [R] Array help

2010-11-29 Thread Patrick Burns
Instead of: 7:1123:34 I think you mean: c(7:11, 23:34) Using '' for concatenation is not an unreasonable idea, but it is decidedly not what R does. It would be instructive to do: 7:11 23:34 at the R prompt to see what you get. On 29/11/2010 03:56, bfhancock wrote: Josh, the

[R] HELPPPPPP

2010-11-29 Thread piccino
please i've a big problem. i've to do a econometric-quantitative methods assignment about the canadian lynx, the problem is that i really i don't know how to use r and how to apply all the steps. I begun the time plot, ACF and PACF but i'm not able to decide what is the correct model of ARIMA,

[R] weighted Spearman correlation coefficient

2010-11-29 Thread Daniel Rabczenko
Hello, I would be grateful if anybody can help me in finding an R function to compute weighted Spearman correlation coefficient? Kind regards, Daniel __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Plot data inside matrix

2010-11-29 Thread alcesgabbo
Hi, I have this problem: I have this matrix: result property procProperty 2010-10-01 07:32:00 40 Asensor1 2010-10-01 17:32:00 15 Asensor3 2010-10-02 07:32:00 32 A

[R] in regards of plotting using functions.

2010-11-29 Thread PRAVIN
Hello, I am using basic plotting technique to get a graph. but i want to color the points plotted onto the graph depending upon few mathematical logics. values x should be colored blue. values y should be colored green. how can i go forward with the programming part in drawing these plots from

Re: [R] Where is gdata?

2010-11-29 Thread Stephen Liu
Hi Spencer, Download and install Strawberry perl from http://strawberryperl.com; Installation went through without problem. Start R library(gdata) gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED. gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED. Attaching package:

[R] surpressing tickmarks / labels x-as for two sets of boxplot (plotted as stacked boxplots)

2010-11-29 Thread Karin
Hello, I am trying to plot two sets of boxplots together. These are estimates of two experiments and seven factors. The results of the two experiments I want to plot as boxplots stacked to each other. Therefore I plot first the results of the first experiment; and next with the add option the

Re: [R] cross tabulate variables by subject id

2010-11-29 Thread Michael Bedward
Hi Marianne, How about this... ac.ad - unstack(dat1, choice ~ cond1:cond2)[, c(A.C, A.D)] acad.xtab - with(ac.ad, table(A.C, A.D)) Michael On 29 November 2010 20:18, Marianne Promberger marianne.promber...@kcl.ac.uk wrote: Dear list, I have data like this: dat1 -

[R] Odp: HELPPPPPP

2010-11-29 Thread Petr PIKAL
Hi What does your teacher says about the procedures you shall use? You shall go through help pages for ?spectrum, ?acf, ?ar and maybe some others. Regards Petr r-help-boun...@r-project.org napsal dne 29.11.2010 11:33:58: please i've a big problem. i've to do a econometric-quantitative

Re: [R] Performance tuning tips when working with wide datasets

2010-11-29 Thread Andreas Borg
Richard Vlasimsky schrieb: Does anyone have any performance tuning tips when working with datasets that are extremely wide (e.g. 20,000 columns)? In particular, I am trying to perform a merge like below: merged_data - merge(data1, data2, by.x=ate,by.y=date,all=TRUE,sort=TRUE); This statement

[R] Odp: in regards of plotting using functions.

2010-11-29 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.11.2010 11:48:07: Hello, I am using basic plotting technique to get a graph. but i want to color the points plotted onto the graph depending upon few mathematical logics. values x should be colored blue. values y should be colored green.

Re: [R] surpressing tickmarks / labels x-as for two sets of boxplot (plotted as stacked boxplots)

2010-11-29 Thread Peter Ehlers
On 2010-11-29 03:17, Karin wrote: Hello, I am trying to plot two sets of boxplots together. These are estimates of two experiments and seven factors. The results of the two experiments I want to plot as boxplots stacked to each other. Therefore I plot first the results of the first experiment;

[R] Moran I for very large data set

2010-11-29 Thread Watmough G.
Hi Are there any more efficient ways of calculating the neighbourhood object for large datasets? I am trying to compute Moran I statistics for a very large data set (over 14,000 points). I have been using moran.test from the spdep package and everything works fine for a small data set (200

Re: [R] in regards of plotting using functions.

2010-11-29 Thread PRAVIN
Thanks for your help guidance. I am taking these values from a file as co-ordinates. I tried using the code for the same but it gave an error. saying X object error. plot((x=[,1],y=[,2]), so how should i embedded the expression within the plot? regards, Pravin On Mon, Nov 29, 2010 at 5:20 PM,

[R] Troubles in plotting to a postscript file (not to png)

2010-11-29 Thread pilchat
Dear R users, I am trying to produce some plots in a postscript file, but I am experiencing some issues. I open the device with - setPS() postscript (file='gs_mcmc_dust.ps',width=5*3,height=5*3,horizontal = FALSE, paper = special,family =

Re: [R] Where is gdata?

2010-11-29 Thread Gabor Grothendieck
On Mon, Nov 29, 2010 at 3:44 AM, Stephen Liu sati...@yahoo.com wrote: Hi Liviu, Not if you library(gdata) first. Then ?read.xls should work. Yes, I did. I found something strange here which I can't explain. Win 7 64bit R 32/64 bit Just rebooted Win 7 and R library(gdata)

Re: [R] Plot data inside matrix

2010-11-29 Thread David Winsemius
On Nov 29, 2010, at 6:22 AM, alcesgabbo wrote: Hi, I have this problem: I have this matrix: Doubtful that is is a matrix. In R matrices are all of the same type of object. This looks more like a zoo object since it has a time index. How was it created and what does str() show?

Re: [R] Array help

2010-11-29 Thread bfhancock
if you can load the PASWR package and pull up StatTemps you will see what I am talking about. Otherwise I fear that my question will just be confusing. -- View this message in context: http://r.789695.n4.nabble.com/Array-help-tp3062992p3063535.html Sent from the R help mailing list archive at

Re: [R] Help Please!!!!!!!!!

2010-11-29 Thread jim holtman
Your data seems to read in just fine, so what is the problem you are trying to solve? x - read.table('clipboard', sep='\t', header=TRUE) str(x) 'data.frame': 5 obs. of 5 variables: $ X : Factor w/ 5 levels JE,JM,S,..: 5 2 4 1 3 $ None : int 4 4 25 18 10 $ Light : int 2 3 10 24 6 $

Re: [R] in regards of plotting using functions.

2010-11-29 Thread Petr PIKAL
Hi PRAVIN 2pravinnil...@gmail.com napsal dne 29.11.2010 13:18:45: Thanks for your help guidance. I am taking these values from a file as co-ordinates. I tried using the code for the same but it gave an error. saying X object error. plot((x=[,1],y=[,2]), What is [,1]? You shall have

[R] attached file

2010-11-29 Thread Lorenzo Melchor
I forgot to attach it... The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP. This e-mail message is confidential and for use by

[R] Problems in running affylmGUI

2010-11-29 Thread Lorenzo Melchor
Hi, I am trying to run affylmGUI on my mac computer. I have already installed the Tlc package as well as Bwidgets through ActiveTcl conversion installing files. However, when running affylmGUI() on R, I keep getting the message in the attached file. I have copied the tcl folders from

[R] List of influential points?

2010-11-29 Thread Schwab,Wilhelm K
Hello all, I fit a linear model to some data and used plot() to create diagnostic plots for the fit; I am having trouble reading the points that R is flagging as influential. Is there a way to get the list of influential points from the fit or its summary, etc.? Most likely, there are a few

[R] selecting only corresponding categories from a confusion matrix

2010-11-29 Thread drflxms
Dear R colleagues, as a result of my calculations regarding the inter-observer-variability in bronchoscopy, I get a confusion matrix like the following: 0 1 1001 1010 11 0609 11 54 36 6 1 1 260 2 1014 008 4 1004 000 0 1000 23

Re: [R] aftreg vs survreg loglogistic aft model (different intercept term)

2010-11-29 Thread Terry Therneau
Survreg maximizes the log-likelihood to a relative tolerance of 1e-9 (?survreg.control). The printout shows -379503.5, to see the rest of the digits you need something like: fit - survreg( print(fit$loglik, digits=9) Aftreg printed even less digits; you would have to do the

Re: [R] Custom ticks on x axis when dates are involved - many thanks!

2010-11-29 Thread Monica Pisica
Hi, I am sorry i am sending this again, but my email was snatched over the weekend by a spam generator and i was not able to send any email out. But now things are again back to normal. Even if i wrote to those who answered my question, i would like to let the list know that i got actually 2

Re: [R] Problems in running affylmGUI

2010-11-29 Thread James W. MacDonald
Hi Lorenzo, Your question pertains to a Bioconductor package, so you are better off posing the question on the BioC-help list (CC'ed). Best, Jim On 11/29/2010 7:47 AM, Lorenzo Melchor wrote: Hi, I am trying to run affylmGUI on my mac computer. I have already installed the Tlc package as

Re: [R] weighted Spearman correlation coefficient

2010-11-29 Thread Łukasz Ręcławowicz
2010/11/29 Daniel Rabczenko dan...@medstat.waw.pl I would be grateful if anybody can help me in finding an R function to compute weighted Spearman correlation coefficient? There is someone, he lives here http://finzi.psych.upenn.edu/search.html But you can write R-code for this coefficient

Re: [R] selecting only corresponding categories from a confusion matrix

2010-11-29 Thread David Winsemius
On Nov 29, 2010, at 8:32 AM, drflxms wrote: Dear R colleagues, as a result of my calculations regarding the inter-observer- variability in bronchoscopy, I get a confusion matrix like the following: 0 1 1001 1010 11 0609 11 54 36 6 1 1 260 2 1014 0

Re: [R] Plot data inside matrix

2010-11-29 Thread alcesgabbo
yes, this is a zoo object. First off all I have: procProperty: sensor3 sensor3 sensor3 sensor3 sensor3 sensor3 sensor3 sensor3 property: A B B A B B A A A data: 40 20 31 32 15 33 15 12 4 I create a matrix with this objects: data-cbind(data,property) data-cbind(data,procProperty) now data

Re: [R] the first. from SAS in R

2010-11-29 Thread Nutter, Benjamin
My apologies for coming to the party so late. I'm sure this question has been answered a couple of times. The attached function is one I pulled from the help archives, but I can't seem to duplicate the search that led me to it. In any case, I've attached the function I found, and an .Rd file I

Re: [R] Troubles in plotting to a postscript file (not to png)

2010-11-29 Thread pilchat
Hi guys, to make it easier, here is a simple case with the same issues. I use the short function below to make the attached PS file. Things to fix: -) the greek letter lambda is not printed, while mu is printed (see the plot command) -) the annotation inside the plot area: the +- symbol and

[R] Do you find trusted Latin wife

2010-11-29 Thread nilie agfa
Do you find trusted Latin wife http://wong.to/tp480 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] FW: R encoding question

2010-11-29 Thread Xiaobo Gu
But Sys.setlocale tries to change the option of the whole OS, I just want only R to use a specified encoding, how can I do this. Xiaobo.Gu -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Monday, November 29, 2010 8:57 PM To: Xiaobo Gu Subject: Re:

Re: [R] Problems in running affylmGUI

2010-11-29 Thread Ben Bolker
Lorenzo Melchor Lorenzo.Melchor at icr.ac.uk writes: I am trying to run affylmGUI on my mac computer. I have already installed the Tlc package as well as Bwidgets through ActiveTcl conversion installing files. However, when running affylmGUI() on R, I keep getting the message in the

[R] data.frame and formula classes of aggregate

2010-11-29 Thread David Freedman
Hi - I apologize for the 2nd post, but I think my question from a few weeks ago may have been overlooked on a Friday afternoon. I might be missing something very obvious, but is it widely known that the aggregate function handles missing values differently depending if a data frame or a formula

[R] Filling in missing time samples with na.approx

2010-11-29 Thread Jason Edgecombe
Hi Everyone, I have a some data from a sports gps device like the following: time latitude longitude altitude distance heartrate 1 1277648884 0.304048 -0.793819 260 0.0094 2 1277648885 0.304056 -0.793772 262 4.30761595 3 127764 0.304060 -0.793696

Re: [R] Troubles in plotting to a postscript file (not to png)

2010-11-29 Thread David Winsemius
On Nov 29, 2010, at 9:00 AM, pilchat wrote: Hi guys, to make it easier, here is a simple case with the same issues. I use the short function below to make the attached PS file. Things to fix: -) the greek letter lambda is not printed, while mu is printed (see the plot command) -) the

Re: [R] data.frame and formula classes of aggregate

2010-11-29 Thread David Winsemius
On Nov 29, 2010, at 9:35 AM, David Freedman wrote: Hi - I apologize for the 2nd post, but I think my question from a few weeks ago may have been overlooked on a Friday afternoon. I might be missing something very obvious, but is it widely known that the aggregate function handles

Re: [R] periodic time series

2010-11-29 Thread pengcafe
http://r.789695.n4.nabble.com/file/n3063697/sample.xlsx sample.xlsx So, here are some sample data. 1st column is a label for 12 hour long days 2nd one a time stamp The rest are the actual measured values for 4 different groups. What would be the best model for such periodic data? Thanks,

Re: [R] Filling in missing time samples with na.approx

2010-11-29 Thread Gabor Grothendieck
On Mon, Nov 29, 2010 at 9:45 AM, Jason Edgecombe ja...@rampaginggeek.com wrote: Hi Everyone, I have a some data from a sports gps device like the following:        time latitude longitude altitude  distance heartrate 1 1277648884 0.304048 -0.793819      260  0.00        94 2 1277648885

Re: [R] RDA Triplot

2010-11-29 Thread Danielwc
Since I am doing an RDA with contraints I get this error message when trying to use biplot.rda: 'biplot.rda' not suitable for models with constraints Daniel 2010/11/26 Jari Oksanen [via R] ml-node+3060660-1324000642-57...@n4.nabble.comml-node%2b3060660-1324000642-57...@n4.nabble.com Danielwc

Re: [R] non-linear fourth-order differential equations

2010-11-29 Thread Ravi Varadhan
OP is asking about a system of fourth-order differential equations, whereas you are telling her how to solve a single, algebraic nonlinear equation. Take a look at package deSolve, and the function `lsode' in that package for solving a system of nonlinear ODEs (given initial values). Ravi.

Re: [R] unexpected behavior using round to 2 digits on randomly generated numbers

2010-11-29 Thread Petr Savicky
On Sun, Nov 28, 2010 at 01:53:05PM -0800, Jeff Newmiller wrote: FAQ 7.31 http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f Additional information concerning rounding errors of double precision and suggestions for R code, which avoids them in

Re: [R] Where is gdata?

2010-11-29 Thread Stephen Liu
Hi Gabor, - snip - .. The following object(s) are masked from 'package:utils': : object.size This is just a message that it can't find perl. If you don't need to use read.xls then you don't need perl so you can ignore the message. If you do need to use read.xls then install perl and

[R] extracting P values from lm model

2010-11-29 Thread Rosario Garcia Gil
Hello I am trying to get out of an lm model the fstatistics, however after I run the model I write names(Model) and the fstatistic does not appear only these. names(Model) [1] coefficients residuals effects rank fitted.values [6] assignqrdf.residual

Re: [R] non-linear fourth-order differential equations

2010-11-29 Thread Wu Gong
Hi Ravi, Thank you for your correction. I hope I didn't mess up anything:) Cheers. Wu - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/non-linear-fourth-order-differential-equations-tp3062805p3063761.html Sent from the R help mailing list archive at

[R] Significance of the difference between two correlation coefficients

2010-11-29 Thread syrvn
Hi, based on the sample size I want to calculate whether to correlation coefficients are significantly different or not. I know that as a first step both coefficients have to be converted to z values using fisher's z transformation. I have done this already but I dont know how to further proceed

Re: [R] Where is gdata?

2010-11-29 Thread Gabor Grothendieck
On Mon, Nov 29, 2010 at 10:18 AM, Stephen Liu sati...@yahoo.com wrote: Hi Gabor, - snip - .. The following object(s) are masked from 'package:utils': :     object.size This is just a message that it can't find perl.  If you don't need to use read.xls then you don't need perl so you can 

[R] Setting default path to library

2010-11-29 Thread Steve_Friedman
Hello I recently upgraded from 2.11.1 to 2.12.0 on a windows machine. When I launch R via TINN - R,(2.3.7.0) most things appear correct. The exception is the path to the library. I store all of the packages in C:\Program_Files \R\R-2.12.0\library Last week when I upgraded I rec'd an error:

Re: [R] How to remove a package.

2010-11-29 Thread Gavin Simpson
On Sun, 2010-11-28 at 07:58 -0800, Stephen Liu wrote: Hi David, Thanks for your advice. I got it. But I can't resolve: *sigh* The packages are listed in alphabetical sort order, hence AER comes before car comes before datasets comes before Ecdat... You just need to page-down through the

[R] Updates for xlsReadWrite (1.5.3) and xlsReadWritePro (1.6.1/3)

2010-11-29 Thread Hans-Peter Suter
The xlsReadWrite[Pro] packages allow to natively read/write Excel files (.xls) on the Win 32-bit platform. About a week ago new package versions have been released: * xlsReadWrite 1.5.3 is available at CRAN (for R2.11/2.12) and from www.swissr.org/download (binary builds for R2.9 - R2.12) *

Re: [R] extracting P values from lm model

2010-11-29 Thread David L Lorenz
Rosario, The summary function will compute the f-statistic, from which you can compute the attained p-value. Here's a snippet that shows the f-stat. summary(lm(Y ~ X))$fstatistic valuenumdfdendf 34.23125 1.0 8.0 Dave From: Rosario Garcia Gil

[R] Setting Values of Elements in a Dataframe

2010-11-29 Thread Lorenzo Isella
Dear All, I am experiencing some problems in resetting the values of some selected elements in a dataframe. Consider d-seq(-1,1,length=16) dim(d)-c(4,4) d-as.data.frame(d) sel_pos-which(d0, arr.ind=TRUE) d[sel_pos]- -9 which returns the error Error in `[-.data.frame`(`*tmp*`, sel_pos,

Re: [R] Where is gdata?

2010-11-29 Thread Stephen Liu
Hi Gabor, Please start at a fresh version of R. Copy and paste your session from the R console rather than relating what happened. Also, what version of gdata are you using? Older versions did not have installXLSXsupport. Show: packageDescription(gdata)$Version win.version()

Re: [R] Setting Values of Elements in a Dataframe

2010-11-29 Thread Henrique Dallazuanna
Try this: d[d 0] - -9 On Mon, Nov 29, 2010 at 1:56 PM, Lorenzo Isella lorenzo.ise...@gmail.comwrote: Dear All, I am experiencing some problems in resetting the values of some selected elements in a dataframe. Consider d-seq(-1,1,length=16) dim(d)-c(4,4) d-as.data.frame(d)

Re: [R] Setting Values of Elements in a Dataframe

2010-11-29 Thread Ivan Calandra
Hi, Not sure why it doesn't work (I would say it's because of the structure of sel_pos, but I don't know how to deal with it). But just do: d[d0] - -9 It does work HTH, Ivan Le 11/29/2010 16:56, Lorenzo Isella a écrit : Dear All, I am experiencing some problems in resetting the values of

[R] Two dimensional Array defined on intevals

2010-11-29 Thread Leon Adams
Hi I am new to R and am trying to set up a two-dimensional array/matrix with the elements defined by the function similar to below. Been trying to use outer with apply but can't seem to get the indexing quite right. Is their a simple way of accomplishing this task ?? -

Re: [R] Setting default path to library

2010-11-29 Thread Henrique Dallazuanna
Take a look in .libPaths() On Mon, Nov 29, 2010 at 1:32 PM, steve_fried...@nps.gov wrote: Hello I recently upgraded from 2.11.1 to 2.12.0 on a windows machine. When I launch R via TINN - R,(2.3.7.0) most things appear correct. The exception is the path to the library. I store all of

Re: [R] Where is gdata?

2010-11-29 Thread Gabor Grothendieck
On Mon, Nov 29, 2010 at 11:00 AM, Stephen Liu sati...@yahoo.com wrote: Hi Gabor, Please start at a fresh version of R.  Copy and paste your session from the R console rather than relating what happened.  Also, what version of gdata are you using?  Older versions did not have

Re: [R] Two dimensional Array defined on intevals

2010-11-29 Thread Jonathan P Daily
Does this work for you? g - function(x,y) ifelse(x .5, 0, 2) + ifelse(y .5, 1, 2) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room,

Re: [R] Significance of the difference between two correlation coefficients

2010-11-29 Thread Adaikalavan Ramasamy
Thanks for providing the example but it would be useful to know who I am communicating with or from which institute, but nevermind ... I don't know much about this subject but a quick google search gives me the following site: http://davidmlane.com/hyperstat/A50760.html Using the info from

Re: [R] Array help

2010-11-29 Thread Joshua Wiley
Hi Brian, I believe there was some miscommunication earlier due to R's array class for objects and the colloquial usage of array (the idea that 'array' is used colloquially is a bit odd, but I digress). In any case, here are some steps I take (certainly not the only ones) when exploring a new

Re: [R] Significance of the difference between two correlation coefficients

2010-11-29 Thread syrvn
Hi, thanks a lot. that's what i tried to figure out! it works great and is exactly what i need. Best, syrvn -- View this message in context: http://r.789695.n4.nabble.com/Significance-of-the-difference-between-two-correlation-coefficients-tp3063765p3063997.html Sent from the R help mailing

[R] how to use by() ?

2010-11-29 Thread Jim Moon
Hello, All! How might one accomplish this using the by() function? m1 is a data frame. # populate column m1$major_allele for ( i in 1:length(m1$major_allele)) { if ( m1$Freq1[i] == m1$MAF[i]){ m1$major_allele[i] = m1$Al1[i] } else{ m1$major_allele[i] = m1$Al2[i] } } Jim

Re: [R] Issues with nnet.default for regression/classification

2010-11-29 Thread Jude Ryan
Hi Georg, The documentation (?nnet) says that y should be a matrix or data frame, but in your case it is a vector. This is most likely the problem, if you do not have other data issues going on. Convert y to a matrix (or data frame) using 'as.matrix' and see if this solves your problem.

Re: [R] data.frame and formula classes of aggregate

2010-11-29 Thread Peter Ehlers
On 2010-11-29 06:35, David Freedman wrote: Hi - I apologize for the 2nd post, but I think my question from a few weeks ago may have been overlooked on a Friday afternoon. I might be missing something very obvious, but is it widely known that the aggregate function handles missing values

Re: [R] how to use by() ?

2010-11-29 Thread Greg Johnson
Jim Moon moonja at ohsu.edu writes: How might one accomplish this using the by() function? m1 is a data frame. # populate column m1$major_allele for ( i in 1:length(m1$major_allele)) { if ( m1$Freq1[i] == m1$MAF[i]){ m1$major_allele[i] = m1$Al1[i] } else{

Re: [R] Filling in missing time samples with na.approx

2010-11-29 Thread Jason Edgecombe
On 11/29/2010 10:00 AM, Gabor Grothendieck wrote: On Mon, Nov 29, 2010 at 9:45 AM, Jason Edgecombe ja...@rampaginggeek.com wrote: Hi Everyone, I have a some data from a sports gps device like the following: time latitude longitude altitude distance heartrate 1 1277648884

[R] FW: how to use by() ?

2010-11-29 Thread Jim Moon
Thank you for the suggestion, Bill. The result is not quite what I would like. Here's sample code for you or anyone else who may be interested: Al1 = c('A','C','C','C') Al2 = c('G','G','G','T') Freq1 = c(0.0078,0.0567,0.9434,0.9908) MAF = c(0.0078,0.0567,0.0566,0.0092) m1 = data.frame(Al1=Al1,

Re: [R] Issues with nnet.default for regression/classification

2010-11-29 Thread Georg Ruß
On 29/11/10 11:57:31, Jude Ryan wrote: Hi Georg, The documentation (?nnet) says that y should be a matrix or data frame, but in your case it is a vector. This is most likely the problem, if you do not have other data issues going on. Convert y to a matrix (or data frame)

Re: [R] how to use by() ?

2010-11-29 Thread Bert Gunter
... or slightly less verbose: m1 - within(m1,major_allele - ifelse( Freq1 == MAF, Al1, Al2 )) ?within Cheers, Bert On Mon, Nov 29, 2010 at 10:25 AM, Greg Johnson g...@nosnhoj.org wrote: Jim Moon moonja at ohsu.edu writes: How might one accomplish this using the by() function? m1 is a

Re: [R] FW: how to use by() ?

2010-11-29 Thread William Dunlap
ifelse(cond,ifTrue,ifFalse) doesn't do what you want when ifTrue or ifElse is a factor. You can use as.character on the factors with(m1, ifelse(Freq1==MAF, as.character(Al2), as.character(Al1))) [1] G G C C or use the stringsAsFactors=FALSE argument to data.frame (or read.table) when you make

Re: [R] how to use by() ?

2010-11-29 Thread Jim Moon
Jim Moon moonja at ohsu.edu writes: How might one accomplish this using the by() function? m1 is a data frame. # populate column m1$major_allele for ( i in 1:length(m1$major_allele)) { if ( m1$Freq1[i] == m1$MAF[i]){ m1$major_allele[i] = m1$Al1[i] } else{

Re: [R] Filling in missing time samples with na.approx

2010-11-29 Thread Gabor Grothendieck
On Mon, Nov 29, 2010 at 1:33 PM, Jason Edgecombe ja...@rampaginggeek.com wrote: On 11/29/2010 10:00 AM, Gabor Grothendieck wrote: On Mon, Nov 29, 2010 at 9:45 AM, Jason Edgecombe ja...@rampaginggeek.com  wrote: Hi Everyone, I have a some data from a sports gps device like the following:

Re: [R] Issues with nnet.default for regression/classification

2010-11-29 Thread Jude Ryan
Good to know that you solved your problem. I did not realize that the default decay parameter = 0 was the cause of the problem. Since I have the MASS book, I was always setting this parameter, in my own work, as indicated in the book, and had no reason to change it. This is probably the first

Re: [R] FW: how to use by() ?

2010-11-29 Thread David Winsemius
On Nov 29, 2010, at 1:36 PM, Jim Moon wrote: Thank you for the suggestion, Bill. The result is not quite what I would like. Here's sample code for you or anyone else who may be interested: Al1 = c('A','C','C','C') Al2 = c('G','G','G','T') Freq1 = c(0.0078,0.0567,0.9434,0.9908) MAF =

Re: [R] FW: how to use by() ?

2010-11-29 Thread Jim Moon
Thank you, Bill. That fixed it. Jim -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Monday, November 29, 2010 10:46 AM To: Jim Moon; r-help@r-project.org Subject: RE: [R] FW: how to use by() ? ifelse(cond,ifTrue,ifFalse) doesn't do what you want when ifTrue

Re: [R] FW: how to use by() ?

2010-11-29 Thread Jim Moon
Well-phrased, David. :-) Jim -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Monday, November 29, 2010 10:53 AM To: Jim Moon Cc: r-help@r-project.org Subject: Re: [R] FW: how to use by() ? On Nov 29, 2010, at 1:36 PM, Jim Moon wrote: Thank you for

Re: [R] data.frame and formula classes of aggregate

2010-11-29 Thread David Freedman
Thanks for the information. There was a discussion of different results obtained with the formula and data.frame methods for a paired t-test -- there are many threads, but one is at http://r.789695.n4.nabble.com/Paired-t-tests-td2325956.html#a2326291 david freedman -- View this message in

[R] drop levels problem

2010-11-29 Thread Felipe Carrillo
Hi all: I am having trouble dropping levels, got a few hints online without success. Please consider the dataset below:  I was under the inpression that subset(..drop=TRUE) would work but it doesn't library(ggplot2)     library(hmisc) x - structure(list(first = c(38.2086, 43.1768, 43.146,

Re: [R] Filling in missing time samples with na.approx

2010-11-29 Thread Felipe Carrillo
strange,,I don't see any change either, could it be that we have an older version of zoo?   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish Wildlife Service California, USA - Original Message From: Gabor Grothendieck ggrothendi...@gmail.com To:

Re: [R] Filling in missing time samples with na.approx

2010-11-29 Thread Gabor Grothendieck
On Mon, Nov 29, 2010 at 2:08 PM, Felipe Carrillo mazatlanmex...@yahoo.com wrote: strange,,I don't see any change either, could it be that we have an older version of zoo? I am using the most recent one on CRAN which is zoo 1.6.4: packageDescription(zoo)$Version [1] 1.6-4 -- Statistics

Re: [R] drop levels problem

2010-11-29 Thread Joshua Wiley
Hi Felipe, On Mon, Nov 29, 2010 at 11:01 AM, Felipe Carrillo mazatlanmex...@yahoo.com wrote: Hi all: I am having trouble dropping levels, got a few hints online without success. Please consider the dataset below:  I was under the inpression that subset(..drop=TRUE) would work but it

Re: [R] drop levels problem

2010-11-29 Thread Henrique Dallazuanna
Take a look on droplevels function (R = 2.12) On Mon, Nov 29, 2010 at 5:01 PM, Felipe Carrillo mazatlanmex...@yahoo.comwrote: Hi all: I am having trouble dropping levels, got a few hints online without success. Please consider the dataset below: I was under the inpression that

Re: [R] drop levels problem

2010-11-29 Thread Felipe Carrillo
Thanks Joshua, I get it now, levels sometimes drive me loco   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish Wildlife Service California, USA - Original Message From: Joshua Wiley jwiley.ps...@gmail.com To: Felipe Carrillo

Re: [R] Subset by using multiple values

2010-11-29 Thread clangkamp
Hi I would like to extend this item to the following: I have the following table X1 X2 X3 value 1 BVEq AGR 11412 954.75 2 CA_Tot AGR 11412 970.59 ... str(DC2_m) 'data.frame': 104160 obs. of 4 variables: $ X1 : Factor w/ 62 levels BVEq,CA_Tot,..: 1 2 3 4 5 6 45 46 47 48 ... ..-

[R] map() and pdf clipping

2010-11-29 Thread Ben Tupper
Hello, Below is a function (test.map) that permits drawing the same map using three different devices. The pdf device doesn't clip polygons to the plot region as I see it does by both the native device (in my case Quartz) and the png device. test.map(pdf) # produces test-map.pdf with

Re: [R] drop levels problem

2010-11-29 Thread Joshua Wiley
Just to follow up on my own post a bit: xmelt$year[xmelt$year == first, drop = TRUE] will do what you want. I think because in the subset there are multiple columns not all of which are factor, the method for '[' being used is not the factor one that would drop unused levels. I did not make

[R] accuracy of GLM dispersion parameters

2010-11-29 Thread Timothy_Handley
I'm confused as to the trustworthiness of the dispersion parameters reported by glm. Any help or advice would be greatly appreciated. Context: I'm interested in using a fitted GLM to make some predictions. Along with the predicted values, I'd also like to have estimates of variance for each of

Re: [R] Subset by using multiple values

2010-11-29 Thread Phil Spector
One possibility would be to paste together the values before subsetting: subset(DC2_m,!paste(as.character(X2),X3,sep='\\0') %in% paste(as.character(Exclude_Data$Code),Exclude_Data$Dates,sep='\\0')) (untested due to lack of a reproducible example). -

  1   2   >