Re: [R] Re-start R issue on win7 [SEC=UNOFFICIAL]

2013-05-09 Thread annoporci
I have not experienced that, but have you tried to see if killing the processes helps? On Windows CTRL+ALT+DEL usually brings up the system monitor or whatever it's called, where you can see programs and processes currently running. If your R gets stuck in a loop then you may see some

Re: [R] help needed in least square curve fit equation

2013-05-09 Thread Wu Gong
As I understand, it is an optimization problem. LeastSquare=sum[y-f(x)]^2 Minimize least square by solving equations about a, b, and c. An iterative method could be developed to get the result or some R functions might be found useful. Please refer

Re: [R] Choice of statistical test (in R) of two apparently different distributions

2013-05-09 Thread Ted Harding
On 09-May-2013 01:42:07 Pascal Oettli wrote: On 05/09/2013 10:29 AM, Gundala Viswanath wrote: I have the following list of data each has 10 samples. The values indicate binding strength of a particular molecule. What I want so show is that 'x' is statistically different from 'y', 'z' and

[R] Time series analysis

2013-05-09 Thread Kai Mx
Hi everybody, I have an analysis problem that seems a little overwhelming to me, but is probably not too hard to solve for you guys. I have a (fairly large) dataframe that indicates usage of a resource on different days: df -data.frame ( dstartday =c(rep('2012-02-10', 4), rep('2012-02-11', 5)),

Re: [R] Replace rows in dataframe based on values in other columns

2013-05-09 Thread arun
Hi, dat1- read.table(text= Restaurant owner purchase_date     23 Chuck 3/4/2011     23 Chuck 3/4/2011     23 Chuck 3/4/2011     23 Chuck 3/4/2011     23 Bob    1/1/2013     23 Bob    1/1/2013     23 Bob 1/1/2013     15

Re: [R] same key row merge in dataframe

2013-05-09 Thread arun
HI, Try this: dat1- read.table(text= V1    V2 A  1 B  2 A 1 B  3 ,sep=,header=TRUE,stringsAsFactors=FALSE) library(plyr) ddply(dat1,.(V1),summarize, V2=list(V2)) #  V1   V2 #1  A 1, 1 #2  B 2, 3 #or aggregate(V2~V1,data=dat1,FUN= function(x) x,simplify=FALSE) #  V1   V2 #1  A 1,

Re: [R] Time series analysis

2013-05-09 Thread Rui Barradas
Hello, If I understand it well, try the following. tmp - lapply(tapply(as.POSIXct(paste(df[,1], df[,2])), df[,1], diff), `*`, 60) lapply(tmp, as.integer) Hope this helps, Rui Barradas Em 09-05-2013 11:45, Kai Mx escreveu: Hi everybody, I have an analysis problem that seems a little

Re: [R] R prints empty group on my figure!!

2013-05-09 Thread PIKAL Petr
Hi Use drop=TRUE argument in interaction for removing unused levels. Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Adel ESSAFI Sent: Wednesday, May 08, 2013 12:48 PM To: r-help Subject: Re: [R] R prints empty group

Re: [R] Time series analysis

2013-05-09 Thread Kai Mx
Hi Rui, thanks for the quick fix. I am still wrapping my mind around your expression, but unfortunately it doesn't quite give me what I want. You are calculating differences between the start times. However, I would like to know the 'idle' periods between the events, ie the time between the end of

Re: [R] NMDS with missing data?

2013-05-09 Thread David Carlson
Since you pass your entire data.frame to metaMDS(), your first error probably comes from the fact that you have included ID as one of the variables. You should look at the results of str(dat) You can drop cases with missing values using dat2 - na.omit(dat) metaMDS(dat2[,-1]) would run the

Re: [R] Time series analysis

2013-05-09 Thread Rui Barradas
Hello, Maybe the following will do it. Note, however, that in your data, for start day 2012-02-11, the end day is always 2012-02-12 so the time differences will be negative. fun2 - function(x){ d - numeric(nrow(x) - 1) for(i in seq_len(nrow(x))[-1]){ start -

[R] Fit a standardized generalized hyperbolic distribution to my data?

2013-05-09 Thread Neuman Co
Hi, I want to fit a standardized generalized hyperbolic distribution to my data, I am using the dsgh command of the fBasics package and the optim command. I tried the following:

[R] R installation error

2013-05-09 Thread Meenu Chopra
Hiii I am trying to install R-2.15.2 after doing ./configure its showing error: --with-x=yes (default) and X11 headers/libs are not available and when i am running make its showing make: *** No targets specified and no makefile found. Stop. Even I read the install file also but i am not getting

[R] Paritioning of Interaction SS in ANOVA - Gomez and Gomez(1984) example

2013-05-09 Thread Lundrigan, Cyril
Hello I'm a new user of R and I'm using Deducer as the interface but also making use of the command interface where necessary. I'm trying to replicate Table 6.18 on page 262 in Statistical Procedures in Agricultural Research, by K. A. Gomez and A. A. Gomez. New York, Chichester, etc.: Wiley

[R] Can you help me sir,

2013-05-09 Thread 심정인
Hi My name is Jeong In Sim, and I'm korean. I'm learning 'R' on my own, so I have a question. I want to make probability density function and cumulative density function when X~Bin(10,0.5) How can I draw graph? Which function do I have to use? I want your help as soon as possible. Thank

Re: [R] Can you help me sir,

2013-05-09 Thread PIKAL Petr
Hi see ?rbinom or other distribution functions ?Distributions for plottting see ?plot ?curve and for cdf see ?ecdf and learn from examples in help pages. Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of ???

Re: [R] Can you help me sir,

2013-05-09 Thread David Carlson
For information on binomial distribution functions: ?dbinom For example: dbinom(0:10, 10, 0.5) [1] 0.0009765625 0.0097656250 0.0439453125 0.1171875000 0.2050781250 [6] 0.2460937500 0.2050781250 0.1171875000 0.0439453125 0.0097656250 [11] 0.0009765625 pbinom(0:10, 10, 0.5) [1] 0.0009765625

Re: [R] R installation error

2013-05-09 Thread PIKAL Petr
Hi you will get probably better help from others but I would recommend you trying to install recent version of R (3.0.0 I believe) And you will be probably asked also about your OS and what exactly you did during installation. Regards Petr -Original Message- From:

Re: [R] R installation error

2013-05-09 Thread Milan Bouchet-Valat
Le jeudi 09 mai 2013 à 14:06 +0100, Meenu Chopra a écrit : Hiii I am trying to install R-2.15.2 after doing ./configure its showing error: --with-x=yes (default) and X11 headers/libs are not available and when i am running make its showing make: *** No targets specified and no makefile

Re: [R] Paritioning of Interaction SS in ANOVA - Gomez and Gomez(1984) example

2013-05-09 Thread peter dalgaard
On May 9, 2013, at 13:58 , Lundrigan, Cyril wrote: Hello I'm a new user of R and I'm using Deducer as the interface but also making use of the command interface where necessary. I'm trying to replicate Table 6.18 on page 262 in Statistical Procedures in Agricultural Research, by K. A.

[R] attr vs attributes

2013-05-09 Thread Murat Tasan
hi all -- i looked through the R Language Definition document, but couldn't find any particular warning or example that would clarify the best use of attribute setting for R objects. let x be some R object, and i'd like to add attribute foo with value bar. case 1: attr(x, foo) - bar case 2:

Re: [R] Paritioning of Interaction SS in ANOVA - Gomez and Gomez(1984) example

2013-05-09 Thread Richard M. Heiberger
Thank you for this example. The way to handle it is with the split argument to the summary.aov function. Look at ?summary.aov for details. I use the reshape package to get the data ordered the way aov wants it. I use the HH package for the graph. ## from:Lundrigan, Cyril

[R] Can DEoptim trace output be customized?

2013-05-09 Thread David Reiner
I'm running DEoptim - it works great! (A HUGE THANK YOU to David Ardia, Katharine Mullen, Brian Peterson, and Joshua Ulrich, and Kris Boudt!!!). Sometimes I set trace to a number so I can see a few intermediate points in the optimization. However, I have a large number of variables and would

Re: [R] Paritioning of Interaction SS in ANOVA - Gomez and Gomez(1984) example

2013-05-09 Thread Lundrigan, Cyril
Thanks Peter! I sent the link to the entire manual since the intermediate steps in that section refer to many other chapters in the book and thought that may be helpful in achieving a solution. I apologize for any inconvenience this may have created for you. Cyril   -Original

Re: [R] Can DEoptim trace output be customized?

2013-05-09 Thread Joshua Ulrich
Hi David, Unfortunately, there's no way for the user to do that. You would need to change line 522 in de4_0.c (where the printing occurs) and rebuild/install the package. Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with

Re: [R] Paritioning of Interaction SS in ANOVA - Gomez and Gomez(1984) example

2013-05-09 Thread Lundrigan, Cyril
Thank-you very much Richard! This is extremely helpful. I would have never thought of approaching it this way but it makes perfect sense. I'm in awe of the promptness and quality of help/advice I'm receiving on this topic - it reflects very well on the R community. All the best! Cyril Lundrigan

[R] creating multivariate normal random variables

2013-05-09 Thread asdf1234
Dear R experts, I am trying to create a dataset, with one dependent binomial and one independen (normal) variable. I have the condition that my x should be created in the following way: if y=0 my x should have mean=0.2 and variance=1 if y=1 my x should have mean=0.7 and variance=1 Furthermore,

[R] subsetting dataframe multiple conditions

2013-05-09 Thread KatrinH Heimann
Dear all, I would like to subset a dataframe using multiple conditions. So if I have two columns 1 and 2, I would like to EXCLUDE all rows in which the value of column 1 is a AND the value of column 2 is b. I tried data[(data$column1 != a data$column2 != b),] but that deletes me every row in

Re: [R] Can DEoptim trace output be customized?

2013-05-09 Thread Katharine Mullen
Dear David, The package doesn't have an option to customize the output of the trace. However, you can create a custom version of the package that doesn't print the parameters. Get the package source code, uncompress it, and find the file de4_0.c in the src/ directory. Then comment out the

[R] Finding x-value of intersections of mixture models

2013-05-09 Thread Ludwig Hilger
Dear list, I am trying to decompose a distribution into 4 normal distributions using the function normalmixEM from package mixtools. This works well, I get four mus and sds. I am now wondering how to get the 3 x values where the distributions intersect. I have tried the following:

Re: [R] Can you help me sir,

2013-05-09 Thread Neuman Co
Well, in general, you can use the following functions: http://stat.ethz.ch/R-manual/R-patched/library/stats/html/Binomial.html See the examples at section Examples. You may want to try the following: n-10 k - seq(0, n, by = 1) plot (k,dbinom(k,n,0.5,log =FALSE),type=l)

[R] Question with apply

2013-05-09 Thread Pooya Lalehzari
Hello, When I use apply on a data frame, it seems like I get an error when I have a column that is not numeric. Via trial and error I realized that if I remove that column, I can get it to run. Is there a better way to tell the function not to worry about the character columns, especially since

Re: [R] subsetting dataframe multiple conditions

2013-05-09 Thread Sarah Goslee
Hi, On Thu, May 9, 2013 at 12:28 PM, KatrinH Heimann katrinheim...@gmail.com wrote: Dear all, I would like to subset a dataframe using multiple conditions. So if I have two columns 1 and 2, I would like to EXCLUDE all rows in which the value of column 1 is a AND the value of column 2 is b. I

Re: [R] subsetting dataframe multiple conditions

2013-05-09 Thread Rui Barradas
Hello, It's difficult to know what's going on without a data example. Can you post the output of dput(head(data, 30)) ? Maybe the columns are not of class character but of class factor. You should also post the output of str(data) In the mean time, try subset(data, column1 != a

Re: [R] subsetting dataframe multiple conditions

2013-05-09 Thread Rui Barradas
Hello, Em 09-05-2013 20:44, Sarah Goslee escreveu: Hi, On Thu, May 9, 2013 at 12:28 PM, KatrinH Heimann katrinheim...@gmail.com wrote: Dear all, I would like to subset a dataframe using multiple conditions. So if I have two columns 1 and 2, I would like to EXCLUDE all rows in which the value

Re: [R] Can DEoptim trace output be customized?

2013-05-09 Thread William Dunlap
You can also turn off DEoptim's trace code and add your own to the function that you supply to DEoptim. You can add print statements to your function by hand or use trace() on it or use the following tracer that keeps track of how many times your function has been called and prints a report once

Re: [R] creating multivariate normal random variables

2013-05-09 Thread David Carlson
What is rbern()? Assuming it should be rbinom(), this can be simplified: set.seed(42) y - rbinom(100, 1, .5) x.1 - rnorm(100, .02, 1) x.2 - rnorm(100, .07, 1) x - ifelse(y==0, x.1, x.2) glm.out = glm(formula = y ~ x, family = binomial(logit)) summary(glm.out) Call: glm(formula = y ~ x,

[R] subsetting by is not

2013-05-09 Thread ramoss
Hello, I have a simple question: I know how to subset by is: buy1 - subset(buy,buybdge==badge) How do I subset if I don't want buybdge to equal badge? Thanks ahead for your help -- View this message in context: http://r.789695.n4.nabble.com/subsetting-by-is-not-tp4666706.html Sent from

Re: [R] subsetting by is not

2013-05-09 Thread ramoss
I want to clarify we are talking about 2 variables in a datframe here. -- View this message in context: http://r.789695.n4.nabble.com/subsetting-by-is-not-tp4666706p4666707.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] subsetting by is not

2013-05-09 Thread Sarah Goslee
Without a reproducible example it's hard to say for certain, but I imagine you want buybdge != badge or !(buybdge == badge) Note that ?== (the help for == ) would have told you that. Sarah On Thu, May 9, 2013 at 4:05 PM, ramoss ramine.mossad...@finra.org wrote: Hello, I have a simple

Re: [R] Question with apply

2013-05-09 Thread David Carlson
The apply() function works on an array or a matrix. There is no need to guess, just read the manual page: ? apply So including a character variable forces the entire matrix to characters. Excluding character variables will let you operate on the numeric values, but your code suggests you are

[R] interpolation in at least 3, perhaps 4 dimensions?

2013-05-09 Thread Benjamin Caldwell
Hello R-helpers, I have a data set of points in three dimensions (x, y, z), each with an associated amplitude. These are data collected using a radar, and of tree roots. There are holes in the data, and I'm interested in interpolating the missing values to create a root map. This could simply be

[R] Raster comparrison

2013-05-09 Thread p m
Dear all, I'm looking for a test to identify significant differences (p-value) between 2 raster maps. Can you suggest me a way to solve this problem? Thank you in advance. Paul [[alternative HTML version deleted]] __ R-help@r-project.org

[R] 'symbols' not drawing correctly in the 'y' dimension

2013-05-09 Thread Damián Cirelli
Hello nice R people, I'm struggling with the following code: plot(c(0, 2), c(0, 2)) symbols(1, 1, circles=0.5, add=T, inches=F) symbols(1, 1, squares=1, add=T, inches=F) abline(v=c(0.5, 1.5), lty=2) abline(h=c(0.5, 1.5), lty=2) The a-b lines in the vertical direction coincide perfectly with the

Re: [R] 'symbols' not drawing correctly in the 'y' dimension

2013-05-09 Thread Sarah Goslee
Hi, On Thu, May 9, 2013 at 4:58 PM, Damián Cirelli cire...@ualberta.ca wrote: Hello nice R people, I'm struggling with the following code: plot(c(0, 2), c(0, 2)) symbols(1, 1, circles=0.5, add=T, inches=F) symbols(1, 1, squares=1, add=T, inches=F) abline(v=c(0.5, 1.5), lty=2)

Re: [R] 'symbols' not drawing correctly in the 'y' dimension

2013-05-09 Thread David Carlson
Change the first line to plot(c(0, 2), c(0, 2), asp=1) That will set the aspect ratio between the vertical and horizontal axes to be equal. - David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77840-4352

Re: [R] 'symbols' not drawing correctly in the 'y' dimension

2013-05-09 Thread Damián Cirelli
Ah! That works. Thank you very much. I interpreted from ?symbols that with inches=F getting the units from x, it was enough to coordinate the units in y. I did not know about asp. Thanks again D On 9 May 2013 15:12, David Carlson dcarl...@tamu.edu wrote: Change the first line to plot(c(0,

Re: [R] Question with apply

2013-05-09 Thread David Winsemius
On May 9, 2013, at 8:50 AM, Pooya Lalehzari wrote: Hello, When I use apply on a data frame, it seems like I get an error when I have a column that is not numeric. Via trial and error I realized that if I remove that column, I can get it to run. Is there a better way to tell the function

[R] duplicate rows with new time series

2013-05-09 Thread Ye Lin
Hey All, I want to duplicate the records but add a new timestamp columns as new time series, but I dont know how to do that. my dataset(dat1) looks like this: No. TimeStamp Var1 1 2012-06-18 06:00:003 2 2012-06-18 06:06:00 4 I use this code to do

Re: [R] duplicate rows with new time series

2013-05-09 Thread Gabor Grothendieck
On Thu, May 9, 2013 at 7:24 PM, Ye Lin ye...@lbl.gov wrote: Hey All, I want to duplicate the records but add a new timestamp columns as new time series, but I dont know how to do that. my dataset(dat1) looks like this: No. TimeStamp Var1 1 2012-06-18 06:00:00

Re: [R] duplicate rows with new time series

2013-05-09 Thread Gabor Grothendieck
On Thu, May 9, 2013 at 8:09 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Thu, May 9, 2013 at 7:24 PM, Ye Lin ye...@lbl.gov wrote: Hey All, I want to duplicate the records but add a new timestamp columns as new time series, but I dont know how to do that. my dataset(dat1) looks

Re: [R] Raster comparrison

2013-05-09 Thread Jeff Newmiller
I am not a GIS expert, but I would be curious to know: Where is the variance information supposed to come from? And, do you have the map positions and scaling aligned already? --- Jeff NewmillerThe

[R] error in barplot

2013-05-09 Thread Carol Van Hulle
Hi all, I am trying to create a barplot for the following data:  ssmsm, ssaudmn, sstacmn  .35, .93, .63  1.9, 1.51., 1.8  .78, 1.6, 1.24  1.10, 1.60, 1.24 I used the following code: sd-read.table(dat.csv, header=T, sep=,) barplot(as.matrix(sd), main=Figure 1, ylab= Mean, beside=TRUE,

Re: [R] error in barplot

2013-05-09 Thread David Winsemius
On May 9, 2013, at 2:22 PM, Carol Van Hulle wrote: Hi all, I am trying to create a barplot for the following data: ssmsm, ssaudmn, sstacmn .35, .93, .63 1.9, 1.51., 1.8 .78, 1.6, 1.24 1.10, 1.60, 1.24 I used the following code: sd-read.table(dat.csv, header=T, sep=,)

Re: [R] R installation error

2013-05-09 Thread Jim Lemon
On 05/09/2013 11:06 PM, Meenu Chopra wrote: Hiii I am trying to install R-2.15.2 after doing ./configure its showing error: --with-x=yes (default) and X11 headers/libs are not available and when i am running make its showing make: *** No targets specified and no makefile found. Stop. Even I

Re: [R] error in barplot

2013-05-09 Thread Jim Lemon
On 05/10/2013 07:22 AM, Carol Van Hulle wrote: Hi all, I am trying to create a barplot for the following data: ssmsm, ssaudmn, sstacmn .35, .93, .63 1.9, 1.51., 1.8 .78, 1.6, 1.24 1.10, 1.60, 1.24 I used the following code: sd-read.table(dat.csv, header=T, sep=,)

[R] How can I extract part of the data with a selection criterion?

2013-05-09 Thread jpm miao
Hi, As an example, how can I get the data such that field a of ab, ab[a], equals 3? I expect the answer to be the union of 2 and 4, as Thanks, a-c(1,3,4,3,5,6,5) b-c(2,4,6,7,3,1,2) ab-data.frame(a,b) ab a b 1 1 2 2 3 4 3 4 6 4 3 7 5 5 3 6 6 1 7 5 2 ab[a==3] Error in

Re: [R] error in barplot

2013-05-09 Thread Jeff Newmiller
I am surprised David failed to comment on your choice of variable name. sd is an extremely commonly-used function, and defining a variable with that name will make it difficult for you to use that function. data is another common function. Some safer options would be dta or sdata. If in doubt,

Re: [R] How can I extract part of the data with a selection criterion?

2013-05-09 Thread Patrick Coulombe
Hi, Try ab[a==3,] You're selecting only rows for which a==3 (before the comma), and all columns (empty condition for column index, after the comma) Patrick 2013/5/9 jpm miao miao...@gmail.com: Hi, As an example, how can I get the data such that field a of ab, ab[a], equals 3? I expect

Re: [R] How can I extract part of the data with a selection criterion?

2013-05-09 Thread David Winsemius
On May 9, 2013, at 7:06 PM, jpm miao wrote: Hi, As an example, how can I get the data such that field a of ab, ab[a], equals 3? I expect the answer to be the union of 2 and 4, as Thanks, a-c(1,3,4,3,5,6,5) b-c(2,4,6,7,3,1,2) ab-data.frame(a,b) ab a b 1 1 2 2 3 4 3 4 6 4 3

[R] Clustering with uneven variables

2013-05-09 Thread Elizabeth McKenzie
Hello, I am new to R (and a novice at statistics). I have a list of objects, with (ideally) 10 different attributes measured per object. However, in reality, I was not able to obtain all 10 attributes for every object, so there is some data missing (unequal number of measured attributes