Re: [R] apply mean function to a subset of data

2016-04-04 Thread Pedro Mardones
2 > 0.271489 1.117015 > > -- > David L. Carlson > Department of Anthropology > Texas A University > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon > Sent: Saturday, April 2, 2016 6:14

[R] apply mean function to a subset of data

2016-04-02 Thread Pedro Mardones
Dear all; This must have a rather simple answer but haven't been able to figure it out: I have a data frame with say 2 groups (group 1 & 2). I want to select from group 1 say "n" rows and calculate the mean; then select "m" rows from group 2 and calculate the mean as well. So far I've been using

[R] select same row in a data frame several times

2014-11-14 Thread Pedro Mardones
Dear R user; Consider the following toy example A - data.frame(ID1 = c(1,2,3,1,2,3,1,2,3), ID2 = c(a,b,c,d,e,f,g,h,i), stringsAsFactors = FALSE) B - sample(a$ID2, 6, replace = TRUE) Lets say B is = a, a, a, h, b, e I want to extract from A the rows where ID2 == B. If I use AA - A[A$ID2 %in% B

[R] data frame manipulation

2014-02-20 Thread Pedro Mardones
Dear R community; I'm kind of stuck with the following situation and would appreciate any hint. Let's assume I have the following data frame: dat - data.frame(ID = c(rep(01,18), rep(02,16)), USE = c(c(001,004, 005,007,001,004,005,007,012,001,004,005,007,001,004,

[R] calculating column difference in a matrix

2013-03-13 Thread Pedro Mardones
Dear R users; Consider the following toy example: a - matrix(c(2,3,4,NA,NA,5,8,NA,8,NA), 5, 2) b - cbind(a,apply(a, 1, diff, na.rm = TRUE)) What I would like be able to get is: c - matrix(c(2,3,4,NA,NA,5,8,NA,8,NA,3,5,-4,8,NA), 5, 3) i.e., for each row if both values (column 1 and 2) are NA

[R] trying to obtain same nls parameters as in example

2012-09-16 Thread Pedro Mardones
Dear R-users; I'm working with a a dataset that was previously used to fit a nonlinear model of the form: Y ~ a * (1 + b * log(1 - c * X^d)) The parameters published elsewhere are: a = 1.758863, b = .217217, c = .99031, and d = .054589 However, there is no way I can replicate this result.

Re: [R] nipals in the chemometrics package in R

2011-12-05 Thread Pedro Mardones
Perhaps you can try the examples given in http://www.jstatsoft.org/v18/i02 for getting a better idea about how the NIPALS algorithm works. BTW, yes,it looks like a homework question specially when your user name is zz dd void1...@gmail.com so you can't be recognized. On Mon, Dec 5, 2011 at 9:27

[R] solid of revolution

2011-11-28 Thread Pedro Mardones
Dear all; I'm tring to find a way to plot a solid of revolution in R, say rotating the 3 param logistic function aaround the x-axis. Is there a way to do it using R? Thanks for any hint PM __ R-help@r-project.org mailing list

Re: [R] help in interpreting paired t-test

2011-09-21 Thread Pedro Mardones
, the greater the power of the t-test to detect the same difference between the means. Jeremy On 20 September 2011 10:46, Pedro Mardones mardone...@gmail.com wrote: Dear all; A very basic question. I have the following data

[R] help in interpreting paired t-test

2011-09-20 Thread Pedro Mardones
Dear all; A very basic question. I have the following data: A - 1/1000*c(347,328,129,122,18,57,105,188,57,257,53,108,336,163, 62,112,334,249,45,244,211,175,174,26,375,346,153,32,

[R] package ChemometricsWithR

2011-02-07 Thread Pedro Mardones
Dear all; Does anyone knows where can I find the package ChemometricsWithR mentioned in http://www.springer.com/life+sciences/bioinformatics/book/978-3-642-17840-5? Thanks for any hint PM [[alternative HTML version deleted]] __

Re: [R] package ChemometricsWithR

2011-02-07 Thread Pedro Mardones
, David Winsemius dwinsem...@comcast.netwrote: On Feb 7, 2011, at 2:31 PM, Pedro Mardones wrote: Dear all; Does anyone knows where can I find the package ChemometricsWithR mentioned in http://www.springer.com/life+sciences/bioinformatics/book/978-3-642-17840-5 ? Thanks for any hint

Re: [R] Satellite ocean color palette?

2009-10-09 Thread Pedro Mardones
tim.colors() in library fields On Fri, Oct 9, 2009 at 2:51 PM, Tim Clark mudiver1...@yahoo.com wrote: Dear List, Is there a color palette avaliable similar to what is used in satellite ocean color imagery?  I.e. a gradient with blue on one end and red on the other, with yellow in the

Re: [R] How to google for R stuff?

2009-05-21 Thread Pedro Mardones
one option could be to type into Google bar something like (for instance for the lme function): filetype R lm On Wed, May 20, 2009 at 9:02 AM, Kynn Jones kyn...@gmail.com wrote: Hi!  I'm new to R programming, though I've been programming in other languages for years. One thing I find most

[R] persp plot + plotting grid lines

2009-03-14 Thread Pedro Mardones
Dear all; Does anyone know how to add grid lines to a persp plot? I've tried using lines(trans3d..) but the lines of course are superimposed into the actual 3d surface and what I need is something like the plot shown in the following link:

[R] don't print object attributes on screen

2009-01-17 Thread Pedro Mardones
Dear all; I have a function written in R that returns as a list of values as output that has associated some user defined attributes to it. How can hide these attributes when printing the output on screen? I'm using R-2.8.1 on WinXPit's like hiding the attr of the output from the scale

Re: [R] reading data from Excel Spread sheet

2009-01-16 Thread Pedro Mardones
or maybe by using the xlsReadWrite package: mydata - read.xls(mydata.xls, sheet = 'Sheet1) On Fri, Jan 16, 2009 at 4:32 AM, venkata kirankumar kiran4u2...@gmail.com wrote: Hi all, I tried to read data from Excel spread sheet with using read.csv(file.choose()) and

[R] SAS LMM to lme syntax

2008-12-20 Thread Pedro Mardones
Dear all; I have the following SAS code: proc mixed data=mydata covtest asycov update; class rep cross; model ht = rep; random col1-col5 / type=toep(1); random cross/type=vc; ods output covparms=_varcomp asycov=_cov; run; where col1-col5 are columns of 0 and 1 (Z matrix of dummy variables)

Re: [R] PCA

2008-11-06 Thread Pedro Mardones
try prcomp instead of princomp On Thu, Nov 6, 2008 at 3:20 PM, Lucke, Joseph F [EMAIL PROTECTED] wrote: Neola I'm a bit rusty on this, but I believe you can conduct on singular-value decomposition on the 436 by 518 matrix. The squares of your singular values (max of 436, 518-436 will be

Re: [R] Label 2 groups in PCA different colours

2008-09-07 Thread Pedro Mardones
here is a simple approach to, for instance, plot scores for PC1 and PC2 using diff colors: scores - prcomp(yourdata)$x plot(scores[1:100,1], scores[1:100,2], pch = 20, col = blue) points(scores[101:200,1], scores[101:200,2], pch = 20, col = red) PM On Sat, Sep 6, 2008 at 11:44 PM, pgseye [EMAIL

Re: [R] summary.manova rank deficiency error + data

2008-08-13 Thread Pedro Mardones
Dalgaard [EMAIL PROTECTED] wrote: Pedro Mardones wrote: Dear R-users; Previously I posted a question about the problem of rank deficiency in summary.manova. As somebody suggested, I'm attaching a small part of the data set. #*** test

[R] manova: R vs SAS...need some clarification

2008-08-12 Thread Pedro Mardones
Dear all; working with a 'fat' data set (700 variables / 50 samples) and trying to run a manova test on it (I'm aware that it's not the best option for this kind of data set) I got the error in the summary.manova function about the rank of the residuals (rank # variables). Ok. The thing that I

[R] summary.manova rank deficiency error + data

2008-08-12 Thread Pedro Mardones
Dear R-users; Previously I posted a question about the problem of rank deficiency in summary.manova. As somebody suggested, I'm attaching a small part of the data set. #*** test - structure(.Data = list(structure(.Data =

[R] levelplot question

2008-06-23 Thread Pedro Mardones
Dear all; I have a data set with 3 groups and 2 response variables, say z1 and z2, and I would like to create a single plot (using the levelplot function) showing on the first row the leveplots for z1 for each group and on the second row levelplots for z2 for the same groups. I tried plot.trellis

Re: [R] levelplot question

2008-06-23 Thread Pedro Mardones
colorkeys for the 2 rows of plots? On Mon, Jun 23, 2008 at 6:59 PM, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 6/23/08, Pedro Mardones [EMAIL PROTECTED] wrote: Dear all; I have a data set with 3 groups and 2 response variables, say z1 and z2, and I would like to create a single plot (using

[R] plot function / par() settings

2008-04-08 Thread Pedro Mardones
Dear all; I'm trying to create a 2 x 3 plot (something I know like lattice can do better) using the plot function. However; I'm not sure how to make the width of the plots to be the same on each column. I guess the answer maybe obvious but I haven't been able to figure it out. I'll appreciate any

[R] ginv and matlab's pinv give different results

2008-02-22 Thread Pedro Mardones
Dear all; I'm kind of confused with the results obtained using the ginv function from package MASS and pinv function from Matlab. Accroding to the documentation both functions performs a Moore-Penrose generalized inverse of a matrix X. The problem is when I change the tolerance value, say to 1E-3.

[R] PCA + Hotelling's T^2

2008-02-09 Thread Pedro Mardones
Dear R users; Is there any function to plot the confidence ellipse (Hotelling's T^2) in an score plot from a PCA? I have the scores off course , say scores for PC1 and PC2, and the value of the Hotelling's T^2 statistic. Thanks for any hint PM __

[R] scatterplot3d + box lines

2008-02-06 Thread Pedro Mardones
Dear all; I've been trying to change the type of line used to draw the box around the 3d scatterplot (package scatterplot3d) from lty=1 to lty=2 without sucess. I would appreciate suggestions of how to do it. Thanks PM __ R-help@r-project.org mailing

[R] error message + boot library

2008-01-28 Thread Pedro Mardones
Dear all; What can be wrong with this simple example? library(boot) d1-c(rnorm(10,mean=10)) fm-function(d,i) mean(d[i]) bd1-boot(d1,fm,1) Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Thanks for any idea __

[R] translating R code to C code

2007-11-06 Thread Pedro Mardones
I would like to try to implement a big series of nested loops in a C code and then call it from R; however I'm not familiar with C programming. Does anyone know about some sort of reference I can use that help me to translate my code to C? (I'm thinking on something like to Octave to R reference

[R] R2.6 + Error saving plots as PDF

2007-10-04 Thread Pedro Mardones
Dear R users; After installing R 2.6.0 I got the following error when I try to save a plot as PDF or PS from the windows plot: Error: Invalid font type In addition: Warning messages: 1: font family not found in PostScript font database 2: font family not found in PostScript font database However