Re: [R] Newbie Question on making subsets for every element of a table column

2012-04-23 Thread Petr Savicky
On Mon, Apr 23, 2012 at 02:33:22PM -0700, cyclondude wrote: > Yes. That is what I was looking for. Is there a simple way to (in this > scenario) > > > > out[[1]] > > v1 v2 > 1 a 1 > 4 a 2 > 7 a 3 > > > a <- out[[1]] > > for each one? Hi. If you want to generate variable nam

[R] Data generation for a distribution

2012-04-23 Thread Mohan Radhakrishnan
Hi, I am a new user and this is a basic question. I have read the posting guidelines too. So if this more appropriate for a statistics forum I will ask them. I have a socket server and client and the bytes are piped to graphite which is a graphing library. The intention is to under

Re: [R] ggplot2 - geom_bar

2012-04-23 Thread Matthias Rieber
On 23.04.2012 20:55, Brian Diggs wrote: > On 4/23/2012 9:24 AM, Matthias Rieber wrote: >> Hello, >> >> I've some problem with the ggplot2. Here's a small example: >> >> [...] >> Is it wrong to use geom_bar with that kind of data? I could avoid this >> issue when I cast the data.frame, but I like to

Re: [R] Scatter plot / LOESS, or LOWESS for more than one parameter

2012-04-23 Thread R. Michael Weylandt
The scatter plot is easy: plot(pH1 ~ pH2, data = OBJ) When you say a loess for each -- how do you break them up? Are there repeat values for pH1? If so, this might be hard to do in base graphics, but ggplot2 would make it easy: library(ggplot2) ggplot(OBJ, aes(x = pH1, y = pH2)) + geom_point() +

Re: [R] Nested longitudinal data

2012-04-23 Thread Bert Gunter
Wrong list. Post on r-sig-mixed-models. -- Bert On Mon, Apr 23, 2012 at 8:46 PM, arun wrote: > Hi, > > I have some difficulty in figuring out whether I am doing correct or not. > > > A brief introduction about the work: It is a light/dark choice test > conducted in insect larvae.  The response i

[R] Nested longitudinal data

2012-04-23 Thread arun
Hi, I have some difficulty in figuring out whether I am doing correct or not. A brief introduction about the work: It is a light/dark choice test conducted in insect larvae.  The response is binary (0- present in dark area, 1-present in light area) and the experiment is run for 15 min, so th

[R] Some Help Needed

2012-04-23 Thread li li
Dear all, I need to do some calculation where the code used are below. I get error message when I choose k to be large, say greater than 25. The error message is "Error in integrate(temp, lower = 0, upper = 1, k, x, rho, m) : the integral is probably divergent". Can anyone give some help on res

[R] Scatter plot / LOESS, or LOWESS for more than one parameter

2012-04-23 Thread David Doyle
Hi folks. If I have the following in my "data" eventpH1pH2 14.0 6.0 24.3 5.9 34.1 6.1 44.0 5.9 and on and on. for about 400 events Is there a way I can get R to plot event vs. pH1 and event vs. pH2 and then do a loess o

[R] change color scheme in mvpart

2012-04-23 Thread leanne heisler
> From: dwinsem...@comcast.net > To: leanneheis...@hotmail.com > Subject: Re: [R] change color scheme in mvpart > Date: Mon, 23 Apr 2012 19:20:06 -0400 > > The fact that you are posting in HTML indicates that a) you have > either not read the Posting Guide or b) do not know enough about your > mai

Re: [R] zipfR help

2012-04-23 Thread R. Michael Weylandt
It depends how you want to ensure that condition -- if you just want to censor at an upper bound of 6k, this is easy: pmin(zmsample, 6000) If you want to sample "as before" but it just happens to all be less than 6000 -- that's not really a rigorous statement, but just go with it -- intuitively,

Re: [R] plot function creating bars instead of lines

2012-04-23 Thread R. Michael Weylandt
It is indeed the fact you're plotting factors, but unless you say what "as intended" is, it's hard to provide exactly what you're seeking. Perhaps this will help though: X <- factor(sample(letters[1:5], 15, TRUE)) Y <- rnorm(15) dats <- data.frame(X, Y) plot(Y ~ X, data = dats) # No good plot(X

Re: [R] .rda vs. .RData

2012-04-23 Thread Jeff Newmiller
My bad, I was thinking of rds (?saveRDS). RData and rda are mentioned under ?data as alternate file extensions for the same data format. Sorry for posting without checking first. --- Jeff NewmillerThe

Re: [R] check for difference.

2012-04-23 Thread R. Michael Weylandt
Lists of numbers of length ~1000 are no problem for the wilcox.test() function (Mann-Whitney is a special case) if you leave the default exact = NULL. The choice of test is all yours. Michael On Mon, Apr 23, 2012 at 12:39 PM, aoife doherty wrote: > Hello > I have two lists of numbers, each list

[R] zipfR help

2012-04-23 Thread meh L
Hi, I have a question on generating random variables based on zipf-mandelbrot distribution. So when I execute the following lines: ZM = lnre ("zm", alpha = 2/3, B=0.1) zmsample = rlnre (ZM, n =100) zmsample It generates 100 random values based on a zipf-mandelbrot distribution as below. But ho

[R] nnet multinom question

2012-04-23 Thread Moritaka Hosotsubo
I'd like to fit a multinomial log-linear model for 4 categories of the form: log[(P(D=i | x)/P(D=0 | x)] = alpha + beta_i x for i = 1,2,3. Is there a way to impose such a constraint in the multinom function of nnet or another function of some library? regards, Hosotsubo -- Moritaka Hosotsubo

Re: [R] .rda vs. .RData

2012-04-23 Thread Ista Zahn
Hi Jeff. Can you point me toward the documentation for "rda saves content of one variable, with no associated name"? I don't seem to find it in ?save ?load etc. Thanks, Ista On Mon, Apr 23, 2012 at 5:58 PM, Jeff Newmiller wrote: > No, RData saves both the variable name and corresponding content

[R] change color scheme in mvpart

2012-04-23 Thread leanne heisler
Hello everyone, I am currently using the mvpart package and would like to change the color scheme it uses, and was hoping someone could help me out. All of the papers I have found have used a grayscale but I can't seem to figure out how they did that! Currently, mvpart plots barplots in a repea

[R] Bivariate Von Mises Distributions

2012-04-23 Thread Cedric Neumann
All, I am trying to estimate the parameters of a bivariate Von Mises distributions. I am looking for somebody to point me in the direction of an R package or function that does this. I have noted the existing packages that allow for obtaining the density values once the parameters have been es

[R] summing two probability density functions from Gompertz hazard model

2012-04-23 Thread piltdownpunk
Hi, r-help members. I have a question about summing two density distributions. I have two samples from which I've estimated hazard parameters for a Gompertz mortality model. With those parameters, I can calculate the PDF (survival function times hazard function) of ages-at-death in a birth cohor

Re: [R] .rda vs. .RData

2012-04-23 Thread Jeff Newmiller
No, RData saves both the variable name and corresponding content of multiple variables. rda saves content of one variable, with no associated name. The latter allows for greater flexibility in importing the data later into different working environments, the former is convenient for recreating

Re: [R] Can I specify POSIX[cl]t column classes inside read.csv?

2012-04-23 Thread Jeff Newmiller
I recommend not putting POSIXlt vectors in data frames because of memory use and added complexity of the resulting data frame. That is, use colClasses = c('character', 'POSIXct', 'POSIXct') instead. The POSIXlt values will still be created as temporary variables for reading in, but the data

Re: [R] Newbie Question on making subsets for every element of a table column

2012-04-23 Thread R. Michael Weylandt
There are, but it's generally considered better style to keep them all in a single list and use lapply() if you want to do things to each element. Michael On Mon, Apr 23, 2012 at 5:33 PM, cyclondude wrote: > Yes. That is what I was looking for.  Is there a simple way to (in this > scenario) > >

Re: [R] automating a script to read a file

2012-04-23 Thread Steve_Friedman
Petr, Thank you very much this works. A little more tweaking and I'll have what I need. Thanks Steve Friedman Ph. D. Ecologist / Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224

Re: [R] Assignment problems

2012-04-23 Thread David Winsemius
On Apr 23, 2012, at 5:21 PM, R. Michael Weylandt wrote: That's not the ifelse() that's the for loop returning NULL (everything's a function!). If you put the assignment inside you'll get expected behavior. x <- (for(i in 1:5) i) # Strange for(i in 1:5) x<- i # Normal (but notice you only get t

Re: [R] Newbie Question on making subsets for every element of a table column

2012-04-23 Thread cyclondude
Yes. That is what I was looking for. Is there a simple way to (in this scenario) > out[[1]] v1 v2 1 a 1 4 a 2 7 a 3 > a <- out[[1]] for each one? Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Newbie-Question-on-making-subsets-for-every-element-of-a

Re: [R] Assignment problems

2012-04-23 Thread R. Michael Weylandt
That's not the ifelse() that's the for loop returning NULL (everything's a function!). If you put the assignment inside you'll get expected behavior. x <- (for(i in 1:5) i) # Strange for(i in 1:5) x<- i # Normal (but notice you only get the last value because previous ones are overwritten) Michae

Re: [R] Assignment problems

2012-04-23 Thread phillip03
Hi > EMU1993<-(for (i in 1:nrow(data)){ + ifelse(year==1992,sum(avgflowEMU),0) + }) >EMU1993 NULL -- View this message in context: http://r.789695.n4.nabble.com/Assignment-problems-tp4578672p4581590.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] How to test if a slope is different than 1?

2012-04-23 Thread Greg Snow
One option is to subtract the continuous variable from y before doing the regression (this works with any regression package/function). The probably better way in R is to use the 'offset' function: formula = I(log(data$AB.obs + 1, 10)-log(data$SIZE,10)) ~ log(data$SIZE, 10) + data$Y formula = log

Re: [R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-23 Thread Greg Snow
Here is a method that uses negative look behind: > tmp <- c('mutation','nonmutated','unmutated','verymutated','other') > grep("(? wrote: > Hello All, > > Started out awhile ago trying to select columns in a dataframe whose names > contain some variation of the word "mutant" using code like: > > n

[R] [R-pkgs] new version of QCAGUI

2012-04-23 Thread Adrian Duşa
Dear All, I have just submitted a new version of the QCAGUI package on CRAN, it should be propagated in a couple of days. This version is nothing but a quick update to the latest Rcmdr base package, and works (as usual) with the QCA package up to version 0.6-5 For the later versions of the QCA pa

Re: [R] automating a script to read a file

2012-04-23 Thread Petr Savicky
On Mon, Apr 23, 2012 at 04:02:45PM -0400, steve_fried...@nps.gov wrote: > > Hi, > > > The following script (which I did not develop) is used to calculate and > plot a skewed normal curve. The script currently requires the user to > input six parameters, rather than reading these directly from a

Re: [R] Newbie Question on making subsets for every element of a table column

2012-04-23 Thread Petr Savicky
On Mon, Apr 23, 2012 at 10:58:26AM -0700, cyclondude wrote: > Hello, very new to R, playing with tables, and I am trying to do > > x <- subset(data, columnlabel == x) > > for every element in my column that I could find by using > > table (data [,"columnlabel"]) Hi. The following may be clos

Re: [R] Assignment problems

2012-04-23 Thread Berend Hasselman
On 23-04-2012, at 21:37, phillip03 wrote: > Thank you! > > Do you know why ifelse() sometimes returns "NULL" ? Please provide a reproducible example for this phenomenon. Berend __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] Assignment problems

2012-04-23 Thread phillip03
Thank you! Do you know why ifelse() sometimes returns "NULL" ? -- View this message in context: http://r.789695.n4.nabble.com/Assignment-problems-tp4578672p4581491.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] need advice on using excel to check data for import into R

2012-04-23 Thread Greg Snow
This is really a job for a database, and Excel is not a database (even though many think it is). I have some clients that I have convinced to create an Access database rather than use Excel (still MS product so it can't be that scary, right?). They were often a little reluctant at first because t

[R] automating a script to read a file

2012-04-23 Thread Steve_Friedman
Hi, The following script (which I did not develop) is used to calculate and plot a skewed normal curve. The script currently requires the user to input six parameters, rather than reading these directly from a file. I've been spinning wheels here, trying to figure out how to modify the script

Re: [R] write a png inside a pdf for large graphics?

2012-04-23 Thread baptiste auguie
Hi, On 24 April 2012 05:00, Duncan Murdoch wrote: > On 23/04/2012 10:49 AM, Adam Wilson wrote: >> >> I routinely write graphics into multi-page PDFs, but some graphics (i.e. >> plots of large spatial datasets using levelplot()) can result in enormous >> files.  I'm curious if there is a better wa

Re: [R] How to insert filename as column in a file

2012-04-23 Thread Shivam
gt; > foo >a b > 1 1 a > 2 2 a > 3 3 a > 4 4 a > 5 5 a > 6 6 a > 7 7 a > 8 8 a > 9 9 a > 10 10 a > > foo$date <- '20120423' > > foo >a b date > 1 1 a 20120423 > 2 2 a 20120423 > 3 3 a 20120423

Re: [R] Assignment problems

2012-04-23 Thread Rui Barradas
> > If I want to make a new data.frame where it is the NONEURO avgflows. how > do I do that ? > Exactly like above, but without the negation (the exclamation mark). You must also start to use the help system, for instance: ?"!" Rui Barradas -- View this message in context: http://r.789695.n

[R] .rda vs. .RData

2012-04-23 Thread Shi, Tao
Are they the same with .RData being the newer format?  Thanks, ...Tao __ 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,

Re: [R] ggplot2 - geom_bar

2012-04-23 Thread Brian Diggs
On 4/23/2012 9:24 AM, Matthias Rieber wrote: Hello, I've some problem with the ggplot2. Here's a small example: --8<-- library(ggplot2) molten<- data.frame(date=c('01','01','01','01', '02','02','02','02'), channel=c('red','red','blue','blue',

Re: [R] How to insert filename as column in a file

2012-04-23 Thread MacQueen, Don
This little example might help. > foo <- data.frame(a=1:10, b=letters[1:0]) > foo a b 1 1 a 2 2 a 3 3 a 4 4 a 5 5 a 6 6 a 7 7 a 8 8 a 9 9 a 10 10 a > foo$date <- '20120423' > foo a b date 1 1 a 20120423 2 2 a 20120423 3 3 a 20120

Re: [R] how to cut files from any folder to another folder?

2012-04-23 Thread MacQueen, Don
see file.rename() -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 4/22/12 1:25 AM, "sagarnikam123" wrote: >i want to cut file from e.g. "abc" folder & put it into another location >with folder name e.g. "xyz" >how should i

Re: [R] Assignment problems

2012-04-23 Thread phillip03
Hi RUI Thank you so much ! I know I have a lot to learn : / sorry for that. If I want to make a new data.frame where it is the NONEURO avgflows. how do I do that ? Ph -- View this message in context: http://r.789695.n4.nabble.com/Assignment-problems-tp4578672p4581164.html Sent from the R hel

[R] Newbie Question on making subsets for every element of a table column

2012-04-23 Thread cyclondude
Hello, very new to R, playing with tables, and I am trying to do x <- subset(data, columnlabel == x) for every element in my column that I could find by using table (data [,"columnlabel"]) I'd appreciate any useful help and I'm sorry if I didn't get the terminology perfect. Thanks. -- Vie

[R] How to test if a slope is different than 1?

2012-04-23 Thread Mark Na
Dear R-helpers, I would like to test if the slope corresponding to a continuous variable in my model (summary below) is different than one. I would appreciate any ideas for how I could do this in R, after having specified and run this model? Many thanks, Mark Na Call: lm(formula = log(data$A

Re: [R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-23 Thread Paul Miller
Hi Bert, Yes, code like: x <- names(yourdataframe) grepl("muta",x) & !grepl("nonmuta|unmuta",x) works perfectly. Thanks very much for your help. Paul --- On Mon, 4/23/12, Bert Gunter wrote: > From: Bert Gunter > Subject: Re: [R] Selecting columns whose names contain "mutated" except whe

Re: [R] How to insert filename as column in a file

2012-04-23 Thread jim holtman
This might do it for you: for (i in fileNames){ input <- read.table(i, .) # you might want to use regular expressions to extract just the date. input$fileName <- i write.table(i, ) } On Mon, Apr 23, 2012 at 12:29 PM, Shivam wrote: > Hi, > > I am relatively new to R. Have

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-23 Thread Jonathan Greenberg
Building in Berend's suggestions I think this function should work for most people (I'm going to wrap it into a package but figured people may want to grab this directly): # Please see http://www.netlib.org/lapack/double/dggev.f for a description of inputs and outputs. Rdggev <- function(A,B,JOBVL

Re: [R] OLS Estimating

2012-04-23 Thread David Winsemius
On Apr 23, 2012, at 12:53 PM, phillip03 wrote: So how would I use the lm() to estimate b_0 and b_1 for example My Y_i and Y_j are data observations how does the lm() use my data.frame ? Have your read "An Introduction to R". Section 11 would appear to cover all the needed topics.

Re: [R] OLS Estimating

2012-04-23 Thread phillip03
So how would I use the lm() to estimate b_0 and b_1 for example My Y_i and Y_j are data observations how does the lm() use my data.frame ? -- View this message in context: http://r.789695.n4.nabble.com/OLS-Estimating-tp4580055p4581048.html Sent from the R help mailing list archive at Nabble.

Re: [R] Assignment problems

2012-04-23 Thread Rui Barradas
Hello, phillip03 wrote > > Thank you Rui > > Can you help me with my ifelse problem - I would like to add a list to my > data.frame where avgflow in those rows where ONLY my country pair both are > in euro > First of all, try to use better (much, much better) code writing. What are you trying

[R] Problem extracting enough coefs from gam (mgcv package)

2012-04-23 Thread Martijn Wieling
Dear useRs, I have used using the excellent mgcv package (version 1.7-12) to create a generalized additive model (gam) including random effects - represented with s(...,bs="re") - on the basis of dialect data. My model contains two random-effect factors (Word and Key - the latter representing a s

[R] glmnet_1.7.3 on windows

2012-04-23 Thread Trevor Hastie
We are aware that glmnet_1.7.3 does not pass for windows and are looking into the problem. It has something to do with the gcc compiler being slightly different on windows versus linux/mac platforms. As soon as we have resolved the issue, we will post a new version to CRAN Trevor Hastie --

Re: [R] Can I specify POSIX[cl]t column classes inside read.csv?

2012-04-23 Thread David Winsemius
On Apr 23, 2012, at 11:48 AM, Thomas Levine wrote: I'm loading a nicely formatted csv file. #!/usr/bin/env Rscript kpi <- read.csv( # This is a dump of the username, date_joined and last_login columns # from the auth_user Django table. 'data/2012-04-23.csv',

Re: [R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-23 Thread Bert Gunter
But maybe ... (see below) -- Bert On Mon, Apr 23, 2012 at 9:25 AM, Paul Miller wrote: > Hello Dr. Winsemius, > > Unfortunately, I also have terms like "krasmutated". So simply selecting > words that start with "muta" won't work in this case. > > Thanks, > > Paul > > > --- On Mon, 4/23/12, David

Re: [R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-23 Thread David Winsemius
On Apr 23, 2012, at 12:25 PM, Paul Miller wrote: Hello Dr. Winsemius, Unfortunately, I also have terms like "krasmutated". So simply selecting words that start with "muta" won't work in this case. You are aware that negative indexing can be used with grep aren't you? -- David. Thanks,

Re: [R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-23 Thread Bert Gunter
Below. -- Bert On Mon, Apr 23, 2012 at 9:10 AM, Paul Miller wrote: > Hello All, > > Started out awhile ago trying to select columns in a dataframe whose names > contain some variation of the word "mutant" using code like: > > names(KRASyn)[grep("muta", names(KRASyn))] > > The idea then would be

Re: [R] write a png inside a pdf for large graphics?

2012-04-23 Thread Duncan Murdoch
On 23/04/2012 10:49 AM, Adam Wilson wrote: I routinely write graphics into multi-page PDFs, but some graphics (i.e. plots of large spatial datasets using levelplot()) can result in enormous files. I'm curious if there is a better way. For example: #First, make some data: library(lattice) d=exp

Re: [R] How can I run package ca (correspondence analysis), which needs rgl, without X11?

2012-04-23 Thread Prof Brian Ripley
On 23/04/2012 17:33, Duncan Murdoch wrote: On 23/04/2012 12:05 PM, Jocelyn Ireson-Paine wrote: I want to invoke R on a Linux Web server from Java, in order to analyse data in ways that would take too long to code, and run too slowly, in Java. In particular, to do correspondence analyses. To this

[R] check for difference.

2012-04-23 Thread aoife doherty
Hello I have two lists of numbers, each list is ~800 numbers long. I want to know if the two lists are significantly different from each other. Could anyone suggest what library in R to use? I think maybe the mann-whitney test, as it is not parametric, but i am unsure if it is suitable as my list

[R] How to insert filename as column in a file

2012-04-23 Thread Shivam
Hi, I am relatively new to R. Have scourged the help files and the www but havent been able to get a solution. I have around 250 csv files, one file for each date. They have columns of all types, numeric, string etc. The name of each file is the date in the form of 'mmdd'. There is no column

[R] glmnet sparse matrix error: dim specifies too large an array

2012-04-23 Thread Nathan Stephens
I'm running into an unexpected error using the glmnet and Matrix packages. I have a matrix that is 8 million rows by 100 columns with 75% of the entries being zero. When I run a vanilla glmnet logistic model on my server with 300 GB of RAM, the task completes in 20 minutes: > x # 8 million x 100

Re: [R] Splitting a dataframe by character vector

2012-04-23 Thread Ben Neal
Thanks Steve, your explanation of the "==" is very helpful, and I will look up ?by. Ben -Original Message- From: S Ellison [mailto:s.elli...@lgcgroup.com] Sent: Mon 4/23/2012 3:19 AM To: Ben Neal; r-help@r-project.org Subject: RE: Splitting a dataframe by character vector > -Or

[R] Can I specify POSIX[cl]t column classes inside read.csv?

2012-04-23 Thread Thomas Levine
I'm loading a nicely formatted csv file.     #!/usr/bin/env Rscript     kpi <- read.csv(       # This is a dump of the username, date_joined and last_login columns       # from the auth_user Django table.       'data/2012-04-23.csv',       colClasses = c('character')     )     print(kpi[sample(nro

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread Rui Barradas
Hello, jeff6868 wrote > > Hi Sarah, > > Thank you for your answer. > Yes I know that my proposition is not necessary the better way to do it. > But my problem concerns only big gaps of course (more than half a day of > missing data, till several months of missing data). > I've already filled s

[R] write a png inside a pdf for large graphics?

2012-04-23 Thread Adam Wilson
I routinely write graphics into multi-page PDFs, but some graphics (i.e. plots of large spatial datasets using levelplot()) can result in enormous files. I'm curious if there is a better way. For example: #First, make some data: library(lattice) d=expand.grid(x=1:1000,y=1:1000) d$z=rnorm(nrow(d)

[R] plot function creating bars instead of lines

2012-04-23 Thread la mer
Hello, I am having a problem where code that plots lines using a different data frame plots bars with the current data frame (I am intended to plot lines). The code specifies lines (see below), so I can't figure out why the results are bars. I suspect that it may have something to do with the fact

Re: [R] How can I run package ca (correspondence analysis), which needs rgl, without X11?

2012-04-23 Thread Duncan Murdoch
On 23/04/2012 12:05 PM, Jocelyn Ireson-Paine wrote: I want to invoke R on a Linux Web server from Java, in order to analyse data in ways that would take too long to code, and run too slowly, in Java. In particular, to do correspondence analyses. To this end, I've installed R version 2.15.0 on my

Re: [R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-23 Thread Paul Miller
Hello Dr. Winsemius, Unfortunately, I also have terms like "krasmutated". So simply selecting words that start with "muta" won't work in this case. Thanks, Paul --- On Mon, 4/23/12, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] Selecting columns whose names contain "mu

Re: [R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-23 Thread David Winsemius
On Apr 23, 2012, at 12:10 PM, Paul Miller wrote: Hello All, Started out awhile ago trying to select columns in a dataframe whose names contain some variation of the word "mutant" using code like: names(KRASyn)[grep("muta", names(KRASyn))] The idea then would be to add together the various

[R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-23 Thread Paul Miller
Hello All, Started out awhile ago trying to select columns in a dataframe whose names contain some variation of the word "mutant" using code like: names(KRASyn)[grep("muta", names(KRASyn))] The idea then would be to add together the various columns using code like: KRASyn$Mutant_comb <- rowSum

[R] How can I run package ca (correspondence analysis), which needs rgl, without X11?

2012-04-23 Thread Jocelyn Ireson-Paine
I want to invoke R on a Linux Web server from Java, in order to analyse data in ways that would take too long to code, and run too slowly, in Java. In particular, to do correspondence analyses. To this end, I've installed R version 2.15.0 on my Web host's x86_64 GNU/Linux machine, and tried usi

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread jeff6868
Hi Rui, Yes you're right. It's me again ^^ This post is the last part (I hope) of my job. You helped me a lot last time for the correlation matrices. I have to leave my work now, so I'll check and test your proposition tomorrow. But it makes no doubt that it'll help me a lot again. I'll tell you

Re: [R] [BioC] Overlay Gene Expression on SNP (copy number) data

2012-04-23 Thread Tengfei Yin
On Mon, Apr 23, 2012 at 6:33 AM, Ekta Jain wrote: > Hello, > Can anyone please suggest any packages in R that can be used to overlay > gene expression data on SNP (affymetrix) copy number ? > Hi Ekta, If you mean visually, as Steve suggested, you could try packages like ggbio, Gviz, Rcytoscape..

Re: [R] Solve an ordinary or generalized eigenvalue problem in R

2012-04-23 Thread John C Nash
This thread reveals that R has some holes in the solution of some of the linear algebra problems that may arise. It looks like Jim Ramsay used a quick and dirty approach to the generalized eigenproblem by using B^(-1) %*% A, which is usually not too successful due to issues with condition of B a

Re: [R] How does survreg ordered factors vs not ordered factors?

2012-04-23 Thread Marc Schwartz
On Apr 23, 2012, at 8:29 AM, wwreith wrote: > Consider the following generic code for a survival model > > survobj<-Surv(data$Time,data$Satisfactory) > survmodel<-survreg(survobj~x1+x2+x3+x4+x5+x6, data=data, dist="weibull") > survsum<-summary(survmodel) > survsum > > My question: Does anyone kn

Re: [R] [BioC] Overlay Gene Expression on SNP (copy number) data

2012-04-23 Thread Paul Shannon
Another possibility for visual display of several kinds of data is RCytoscape, for which an example can be seen here: http://rcytoscape.systemsbiology.net/versions/current/gallery/TCGA/subnet.TCGA.02.0014.png This portrays 1) gene expression (green: under-expression; red: over-expression) 2

Re: [R] R-help Digest, Vol 110, Issue 23

2012-04-23 Thread Terry Therneau
Yes, the (start, stop] formalism is the easiest way to deal with time dependent data. Each individual only needs to have sufficient data to describe them, so for if id number 4 is in house 1, their housemate #1 was eaten at time 2, and the were eaten at time 10, the following is sufficient dat

[R] clusplot() for all used variables - not only for 2 principal components?

2012-04-23 Thread greatest.possible.newbie
Hi there, To see the results of my clustering graphically I was using clusplot. But it only provides a look at the two most important components of the dataset. I recently found the Mclust() function which produces very nice colored pair plots for the clustered dataset. see Graph: http://www.stat

Re: [R] save model summary

2012-04-23 Thread Berend Hasselman
On 23-04-2012, at 15:20, Eiko Fried wrote: > Hello, > > I'm working with RStudio, which does not display enough lines in the > console that I can read the summary of my (due to the covariance-matrix > rather long) model. There are no ways around this, so I guess I need to > export the summary in

[R] How does survreg ordered factors vs not ordered factors?

2012-04-23 Thread wwreith
Consider the following generic code for a survival model survobj<-Surv(data$Time,data$Satisfactory) survmodel<-survreg(survobj~x1+x2+x3+x4+x5+x6, data=data, dist="weibull") survsum<-summary(survmodel) survsum My question: Does anyone know what exactly survreg() does differently if x1<-factor(dat

[R] save model summary

2012-04-23 Thread Eiko Fried
Hello, I'm working with RStudio, which does not display enough lines in the console that I can read the summary of my (due to the covariance-matrix rather long) model. There are no ways around this, so I guess I need to export the summary into a file in order to see it ... I'm new to R, and "R sa

[R] PCA sensitive to outliers?

2012-04-23 Thread Igor Carron
I could not reply directly to the initial thread with the same title. There are two sorts of Robust PCA, those that were devised before the recent string of Low Rank approaches and then the new set of algorithms that provide robust PCA in light of sparse but potentially large errors/outliers (typi

Re: [R] How to take ID of number > 7.

2012-04-23 Thread Yellow
Thanks for saying. :) This morning I tried out some things with this code, and different variants with it. Works nice. -- View this message in context: http://r.789695.n4.nabble.com/How-to-take-ID-of-number-7-tp4577998p4580364.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Survreg

2012-04-23 Thread Terry Therneau
On 04/22/2012 05:00 AM, r-help-requ...@r-project.org wrote: I am trying to run Weibull PH model in R. Assume in the data set I have x1 a continuous variable and x2 a categorical variable with two classes (0= sick and 1= healthy). I fit the model in the following way. Test=survreg(Surv(t

Re: [R] lm()

2012-04-23 Thread Stephen Sefick
Rpart has a built in cross-validation proceedure. the xerror and so on are based on a ten fold cross validation, I believe. Read the manual for more results. If you plot the fit with post and then look at the postscript file it should have a misclassification rate under the terminal nodes.

Re: [R] OLS Estimating

2012-04-23 Thread Uwe Ligges
On 23.04.2012 12:42, phillip03 wrote: Hi I am looking for a efficient way to estimate all parameters in your data.frame set using a specific function: for example ln(T)=b_0 + b_1*ln(Y_i*Y_j) + b_2*ln()+ ... + etc. Sounds like you are looking for lm(). Uwe Ligges Thanks, Ph -- View thi

[R] OLS Estimating

2012-04-23 Thread phillip03
Hi I am looking for a efficient way to estimate all parameters in your data.frame set using a specific function: for example ln(T)=b_0 + b_1*ln(Y_i*Y_j) + b_2*ln()+ ... + etc. Thanks, Ph -- View this message in context: http://r.789695.n4.nabble.com/OLS-Estimating-tp4580055p4580055.html Sent

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread jeff6868
Hi Sarah, Thank you for your answer. Yes I know that my proposition is not necessary the better way to do it. But my problem concerns only big gaps of course (more than half a day of missing data, till several months of missing data). I've already filled small gaps with the interpolation that you

[R] compare bivariate normal distributions

2012-04-23 Thread Fabian Roger
Dear all, I have tow (several) bivariate distributions with a known mean and variance-covariance structure (hence a known density function) that I would like to compare in order to get an intersect that tells me something about "how different" these distributions are (as t-statistics for univa

Re: [R] lm()

2012-04-23 Thread Mariam
Hi, Jorge! Help me please! I made a classification tree (rpart package) according to my train data and set of variables. How can I validate my test data? I want to check if the test data will classified properly by the same tree. Thanks cheers Maria Tue, 10 Apr 2012 08:44:39 -0700 (PDT) от "J

[R] Different results for sparse and dense version of model matrix using contrasts and interactions

2012-04-23 Thread Jelmer Ypma
Dear all, I've been getting different results from the sparse and dense version of model.Matrix when used with sparse contrasts and interactions between factors. The same happens when using model.matrix and sparse.model.matrix. When calculating list.contrasts I get the same results for sparse and

[R] Add attributes to igraph vector by name, not index

2012-04-23 Thread cwdillon
Hi, So I've been figuring out how to use igraph in R and like it for it's speed and simplicity. Now I have a graph built from an edgelist where vectors have a $name attribute. I have another dataframe with attributes tied to a vector ID, which is the same as the $name attribute of vectors represe

Re: [R] How to take ID of number > 7.

2012-04-23 Thread Steve Lianoglou
Small mistake in my subset example. I mean to remove the `$ID` part at the end so that you can play with the whole subset-ted data.frame, and not just get back the ID column. Instead of this: R> interesting <- subset(DataFile, log2 >= 7)$ID do this: R> interesting <- subset(DataFile, log2 >= 7)

Re: [R] [BioC] Overlay Gene Expression on SNP (copy number) data

2012-04-23 Thread Steve Lianoglou
Hi, On Mon, Apr 23, 2012 at 7:33 AM, Ekta Jain wrote: > Hello, > Can anyone please suggest any packages in R that can be used to overlay gene > expression data on SNP (affymetrix) copy number ? I guess you mean visually? If so, I'd suggest skimming through the vignettes of the following package

[R] Overlay Gene Expression on SNP (copy number) data

2012-04-23 Thread Ekta Jain
Hello, Can anyone please suggest any packages in R that can be used to overlay gene expression data on SNP (affymetrix) copy number ? Thanks, Ekta Senior Research Associate Bioinformatics Department Jubilant Biosys Pvt Ltd, #96, Industrial Suburb, 2nd Stage Yeshwantpur, Bangalore 560 022 Ph No :

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread Sarah Goslee
Hi, Even your example should show why this is a bad way to fill in missing weather data: you end up with a sequence for station 1 of 1, 2, 10, 4 even though that's certainly wrong because Station 2 is reliably 7 units above Station 1. "Correlated" doesn't mean "identical." There are other bett

[R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread jeff6868
Hi everyone. I have a question about a work on R I have to do for my job. I have temperature data coming from 70 weather stations. One data file corresponds to one station for one year (so 70 files for one year). Each file looks like this (important: each file contains NAs): time

Re: [R] Splitting a dataframe by character vector

2012-04-23 Thread S Ellison
> -Original Message- > I am just trying to split a dataframe of 750 observations of > 29 variables by "Site", which is a vector in the dataframe > with five text names (ex. PtaCaracol). A couple of methods. i) First, look up ?split, which chops your data frame into a list of five data

  1   2   >