[R] How would you calculate this type of p-value using R?

2011-08-16 Thread RQuestion
Let's say you want to compare "one observation" with a sample, how would you use R to get a p-value for that single observation itself? To clarify what I'm asking: We know you use a one-sample t test to compare an actual sample to a hypothetical value, and a Wilcoxon test if it's not normally dis

[R] Copulas and three vectors

2011-08-16 Thread Jakub Mikians
Hi i have a question about "copula" package ( http://cran.r-project.org/web/packages/copula/copula.pdf , http://www.jstatsoft.org/v21/i04/paper ) Using copulas, I want to generate three random vectors V1, V2 and V3, where both pairs (V1, V2) and (V1,V3) have the same dependency structure, defined

Re: [R] Newbie question - struggling with boxplots

2011-08-16 Thread Glen Barnett
something like this? par(mfrow=c(2,2)) boxplot(Sepal.Length~Species,data=iris,main='Sepal Length') boxplot(Sepal.Width~Species,data=iris,main='Sepal Width') boxplot(Petal.Length~Species,data=iris,main='Petal Length') boxplot(Petal.Width~Species,data=iris,main='Petal Width') par(mfrow=c(1,1))

Re: [R] 3D surface plot

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 11:07 PM, Eric Heupel wrote: Thanks for the prompt reply. Will dig into rgl ASAP. My sample data set is: B,C,D,A 1,1,1,1 1,1,2,0.5 2,1,1,2 1,2,1,2 1,1,3,0.3 3,1,1,3 1,3,1,3 2,1,2,1 1,2,2,1 2,2,1,4 2,1,3,0.7 3,1,2,1.5 1,2,3,0.7 1,3,2,1.5 3,2,1,6 2,3

Re: [R] Unusual separators

2011-08-16 Thread Jim Holtman
just read in the file using the tab as the separator. if this is a problem because a tab might appear by itself, then use readLines to read in the file, gsub to replace the blank/tab with a new separator, writeLines to write out to a temporary and then read in from the temporary file. Sent fro

Re: [R] constraining betas with mlogit package

2011-08-16 Thread Essers, Jonah
Guys, thanks for the input. These are numerical variables. Let me give more detail. want to test the likelihood of my data given a varying set of categorical outcomes given the data of a single observation (SNP) and 10 pre-defined principal components from population genetic experiments. The

Re: [R] getting names of dimnames of xtabs into xtable latex output

2011-08-16 Thread Duncan Mackay
Hi Will this fix the problem? str(table2) xtable(data.frame(table2)) % latex table generated in R 2.13.1 by xtable 1.5-6 package % Wed Aug 17 13:02:38 2011 \begin{table}[ht] \begin{center} \begin{tabular}{rllr} \hline & change\_diet & mydiet & Freq \\ \hline 1 & Don't know & 0 & 26.00 \\

Re: [R] 3D surface plot

2011-08-16 Thread Eric Heupel
Thanks for the prompt reply. Will dig into rgl ASAP. My sample data set is: B,C,D,A 1,1,1,1 1,1,2,0.5 2,1,1,2 1,2,1,2 1,1,3,0.3 3,1,1,3 1,3,1,3 2,1,2,1 1,2,2,1 2,2,1,4 2,1,3,0.7 3,1,2,1.5 1,2,3,0.7 1,3,2,1.5 3,2,1,6 2,3,1,6 2,2,2,2 3,1,3,1 1,3,3,1 3,3,1,9 2,2,3,1.

Re: [R] issue with image plot in 2.13.1

2011-08-16 Thread Dennis Murphy
Hi: This has been reported several times in the past several weeks; try upgrading to the patched version of 2.13.1. That seems to have worked for most people who've encountered the problem. HTH, Dennis On Tue, Aug 16, 2011 at 4:41 PM, Swanson, Alan wrote: > R gurus, > I'm having an issue with t

Re: [R] 3D surface plot

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 9:50 PM, Eric Heupel wrote: I have what is probably a noob question, but I am trying to create a 3d plot to illustrate the range of values for the following simple function: A = B*(C/D) B, C, and D are independent variables whose range are equal (e.g. 1 to 3 incl

[R] 3D surface plot

2011-08-16 Thread Eric Heupel
I have what is probably a noob question, but I am trying to create a 3d plot to illustrate the range of values for the following simple function: A = B*(C/D) B, C, and D are independent variables whose range are equal (e.g. 1 to 3 inclusive) I figure it's not possible to map the surface

[R] Why does the graph converge?

2011-08-16 Thread mousy0815
I have a set of functions: Probability <- function(N, f, w, b, l, n, q) { #N is the number of lymph nodes #f is the fraction of Dendritic cells (in the correct node) that have the antigen #w is time in terms of hours #b is the starting position (somewhere in the no

[R] extract variables from model formula

2011-08-16 Thread Joshua Wiley
Hi All, I am writing a function to predict values based on a model. It works fine as long as the formula just uses regular variable names. I am having a problem when the variables are wrapped with a function call. For example: m <- lm(mpg ~ factor(cyl), data = mtcars) ## I get the column names

Re: [R] Newbie question - struggling with boxplots

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 5:24 PM, Geoffrey Stoel wrote: Hopefully I will not be flamed for this on the list, but I am starting out with R and having some trouble with combining plots. I am playing with the famous iris dataset (checking out example dataset in R while reading through Introductio

[R] Sweave and graphics

2011-08-16 Thread Eduardo M. A. M.Mendes
Dear R-Users I think I am getting the hang of how sweave works. However there is one thing I am struggling with - nice small size graphics. Here is the piece of the Rnw file that creates the figures. <>= #pdf(file="datapl1.pdf",paper="a4",width=0,height=0); plot(yt,ypred,xlab="Data",

Re: [R] issue with image plot in 2.13.1

2011-08-16 Thread Jorge I Velez
Hi Alan, Thank you for the reproducible example. One way to solve it is setting "len" to a bigger number, e.g. len = 500. However, this might slow down the plotting. HTH, Jorge On Aug 16, 2011, at 7:41 PM, Swanson, Alan wrote: > R gurus, > I'm having an issue with the appearance of image plots

[R] Symbol Font Baseline, Cairo, Card Symbols

2011-08-16 Thread ivo welch
I think I found a bug in the Cairo library, plus weird behavior in both the Cairo and the normal pdf device. The baseline of the spades symbol seems to be off. This is easier to show than it is to explain. The problem does not appear in the normal pdf device, which is why I am guessing this is a

[R] issue with image plot in 2.13.1

2011-08-16 Thread Swanson, Alan
R gurus, I'm having an issue with the appearance of image plots produced by R-2.13.1. When I plot an image (example code pasted below), thin white lines appear between rows and columns of pixels. The location of the lines seems somewhat random and change as the graphics device is re-sized. Th

Re: [R] Newbie question - struggling with boxplots

2011-08-16 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Ista Zahn > Sent: Tuesday, August 16, 2011 4:13 PM > To: g.st...@hourglazz.com > Cc: r-help@r-project.org > Subject: Re: [R] Newbie question - struggling with boxplots > > On Tue

Re: [R] how to sort the levels of a table

2011-08-16 Thread Ista Zahn
I'm not entirely sure I understand, but (can't let that stop me, I'd never get anything done) see inline below. On Tue, Aug 16, 2011 at 6:57 PM, drflxms wrote: > Dear colleagues, > > I have really heavy problems in sorting the results of a table according > to certain features of the levels in th

Re: [R] Newbie question - struggling with boxplots

2011-08-16 Thread Ista Zahn
On Tue, Aug 16, 2011 at 5:24 PM, Geoffrey Stoel wrote: > Hopefully I will not be flamed for this on the list, but I am starting out > with R and having some trouble with combining plots. > > I am playing with the famous iris dataset (checking out example dataset in R > while reading through Introd

Re: [R] merge(join) problem

2011-08-16 Thread Ista Zahn
On Tue, Aug 16, 2011 at 6:40 PM, Sam Steingold wrote: >> * Ista Zahn [2011-08-16 18:31:00 -0400]: >> On Tue, Aug 16, 2011 at 6:29 PM, Ista Zahn wrote: >>> Hi Tia, > > "tia" == "thanks in advance" :-) *facepalm* Thanks Sam, one day I'll learn internet acronyms... > >> AB3 <- AB2[order(AB$Time,

Re: [R] How to use 'switch' with strings containing spaces?

2011-08-16 Thread Richard M. Heiberger
The problem is that your argument expr is undefined. This works > switch("Choice 2", "Choice 1"="My first choice", "Choice 2"="My 2nd choice", "Choice 3"="My 3rd choice") [1] "My 2nd choice" > x <- "Choice 2" > switch(x, "Choice 1"="My first choice", "Choice 2"="My 2nd choice", "Choice 3"="My 3rd

[R] how to sort the levels of a table

2011-08-16 Thread drflxms
Dear colleagues, I have really heavy problems in sorting the results of a table according to certain features of the levels in the table. Prerequisites: It all starts with a fairly simple data set, which stores observations of 21 observers (horizontally from 1 to 21; 21 is reference/goldstandard

[R] temporal disaggregation

2011-08-16 Thread John C Frain
The Quillis program is really a combination of MATLAB functions and an Excel interface You could recode his MATLAB routines in R and run them direct from R. Alternatively the MATLAB routines should run in Octave after some minor amendments. If you just need Chow Lin you might consider coding the

Re: [R] trouble installing packages on OpenSuse 11.4

2011-08-16 Thread Rolf Turner
I don't know from OpenSuse, but your R CMD INSTALL syntax doesn't look right to me. It certainly wouldn't be right under Ubuntu. What I would do under Ubuntu is: * download the package from CRAN; this is in the form of a gzipped tar file ``fImport_2110.79.tar.gz''. * R CMD INSTALL

Re: [R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Newbie
thank you for your help! kinds Rikke -- View this message in context: http://r.789695.n4.nabble.com/Calibrating-the-risk-free-interest-rate-using-nlminb-tp3747509p3748442.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-proje

[R] Newbie question - struggling with boxplots

2011-08-16 Thread Geoffrey Stoel
Hopefully I will not be flamed for this on the list, but I am starting out with R and having some trouble with combining plots. I am playing with the famous iris dataset (checking out example dataset in R while reading through Introduction to datamining) What I would like to do is create three gr

Re: [R] How to use 'switch' with strings containing spaces?

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 4:53 PM, Mauricio Cornejo wrote: Hi, Does anyone know if the alternatives in the 'switch' function can be specified as strings containing spaces? Neither of the two approaches below works. switch(expr, "Choice 1"="My first choice", "Choice 2"="My 2nd choice", "Cho

Re: [R] merge(join) problem

2011-08-16 Thread Sam Steingold
> * Ista Zahn [2011-08-16 18:31:00 -0400]: > On Tue, Aug 16, 2011 at 6:29 PM, Ista Zahn wrote: >> Hi Tia, "tia" == "thanks in advance" :-) > AB3 <- AB2[order(AB$Time, decreasing=TRUE), ] > AB4 <- AB3[!duplicated(AB3[c("Name", "Open")]), ] thanks! -- Sam Steingold (http://sds.podval.org/) on

Re: [R] merge(join) problem

2011-08-16 Thread Ista Zahn
On Tue, Aug 16, 2011 at 6:29 PM, Ista Zahn wrote: > Hi Tia, > > On Tue, Aug 16, 2011 at 6:00 PM, Sam Steingold wrote: >> I have two datasets: >> A with columns Open and Name (and many others, irrelevant to the merge) >> B with columns Time and Name (and many others, irrelevant to the merge) >> >>

Re: [R] merge(join) problem

2011-08-16 Thread Ista Zahn
Hi Tia, On Tue, Aug 16, 2011 at 6:00 PM, Sam Steingold wrote: > I have two datasets: > A with columns Open and Name (and many others, irrelevant to the merge) > B with columns Time and Name (and many others, irrelevant to the merge) > > I want the dataset AB with all these columns > Open from A -

[R] merge(join) problem

2011-08-16 Thread Sam Steingold
I have two datasets: A with columns Open and Name (and many others, irrelevant to the merge) B with columns Time and Name (and many others, irrelevant to the merge) I want the dataset AB with all these columns Open from A - a difftime (time of day) Time from B - a difftime (time of day) Name (same

[R] Chi square test on data frame

2011-08-16 Thread Bansal, Vikas
Dear all, I have been working on this problem from so many hours but did not find any solution. I have a data frame with 8 columns- V1 V2 V3 V4 W1 W2W3 W4 1 084 22 10 0 84 0 0 235840

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread Hadley Wickham
>> You will get the warning that last last column is not "going right" but >> otherwise this returns what you asked for: >> >> sapply(1:length(mydf), function(i) mydf[[i]]* as.numeric(names(mydf)[i])  ) > > This suits my purposes well with a couple slight modifications: > > ## I made this into a da

Re: [R] Query for semi-transparency support

2011-08-16 Thread Jesse Brown
Thanks for the pointer. I looked through the source and it seems that this is hard-coded into the device-specific files. Considering that, I can think of three ways I could achieve this behavior: 1 - Using .Device in a switch statement 2 - A try/catch construct that will trigger on warnings (

[R] How to use 'switch' with strings containing spaces?

2011-08-16 Thread Mauricio Cornejo
Hi, Does anyone know if the alternatives in the 'switch' function can be specified as strings containing spaces?  Neither of the two approaches below works. switch(expr, "Choice 1"="My first choice", "Choice 2"="My 2nd choice", "Choice 3"="My 3rd choice") x <- c("Choice 1", "Choice 2", "Choi

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread Sam Albers
Thanks for the response David. On Tue, Aug 16, 2011 at 1:13 PM, David Winsemius wrote: > > On Aug 16, 2011, at 3:37 PM, Sam Albers wrote: > >> ## Hello there, >> ## I have an issue where I need to use the value of column names to >> multiply with the individual values in a column and I have many

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread Bert Gunter
Sorry, my second should be: scale(mydf[,1:3],center = FALSE, scale=1/as.numeric(names(mydf)[1:3])) ## ?scale -- Bert On Tue, Aug 16, 2011 at 1:30 PM, Bert Gunter wrote: > How about: > > as.matrix(mydf[,1:3]) %*%  diag(as.numeric(names(mydf)[1:3])) > > or > >  scale(mydf[,1:3],1/as.numeric(nam

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread Bert Gunter
How about: as.matrix(mydf[,1:3]) %*% diag(as.numeric(names(mydf)[1:3])) or scale(mydf[,1:3],1/as.numeric(names(mydf)[1:3])) ## ?scale to create your new columns? -- Bert On Tue, Aug 16, 2011 at 1:13 PM, David Winsemius wrote: > > On Aug 16, 2011, at 3:37 PM, Sam Albers wrote: > >> ## Hello

[R] count dinucleotides in DNA using "count " function in "seqinr" package

2011-08-16 Thread Sara Kamali
  Dear all I want to count the number of dinucleotides of multiple DNA sequences from a csv file seprately using "count" function in "seqinr" package . it works for one sequence , but when I put this function in a for loop it gives zero for all nucleotides . i would be thankful if someone can h

[R] cannot get to R2.13 using zypper in OpenSuse 11.4

2011-08-16 Thread Dinesh
Hi, I am trying to install R2.13 under OpenSuse 11.4 on an Intel desktop. I used the following instructions from (http://cran.r-project.org/bin/linux/suse/#sec-1_4): || |zypper ar -f http://download.opensuse.org/repositories/devel:languages:R:patched/openSUSE_11.4 R-patched| | then,| |zypper

[R] trouble installing packages on OpenSuse 11.4

2011-08-16 Thread Dinesh
Hi, I am trying to install a bunch of packages via command line and can use some help in getting it right. My env is a freshly setup OpenSuse 11.4 on an amd desktop. I have not yet installed gcc (Will I need gcc to install packages? I have installed make, assuming R might need it.). I have tri

Re: [R] What's your favourite R book that doesn't have R in the title?

2011-08-16 Thread senne
I'm reading 'Statistics and Data Analysis for Financial Engineering ', some people might be turned off by the name, but actually it's pretty about everything, very easy to follow and have some good discussion. On Tue, Aug 16, 2011 at 2:14 PM, Paul Miller wrote: > Hello All, > > Recently, I discov

Re: [R] Utilizing column names to multiply over all columns

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 3:37 PM, Sam Albers wrote: ## Hello there, ## I have an issue where I need to use the value of column names to multiply with the individual values in a column and I have many columns to do this over. I have data like this where the column names are numbers: mydf <- data.fra

[R] Utilizing column names to multiply over all columns

2011-08-16 Thread Sam Albers
## Hello there, ## I have an issue where I need to use the value of column names to multiply with the individual values in a column and I have many columns to do this over. I have data like this where the column names are numbers: mydf <- data.frame(`2.72`=runif(20, 0, 125), `3.2

[R] cuminc() in cmprsk package for cumulative incidence

2011-08-16 Thread array chip
Hi, To use cuminc() from cmprsk package, if a subject has 2 events (both the event of interest and the event of competing risk), should I create 2 observations for this subject in the dataset, one for each event with different fstatus (1 and 2), or just 1 observation with whatever event that

Re: [R] What's your favourite R book that doesn't have R in the title?

2011-08-16 Thread Paul Miller
I can add one more title. The foundations of statistics: A simulation-based approach by Vasishth and Broe. Paul __ 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/

Re: [R] Assignment working differently inside ifelse()

2011-08-16 Thread Stuart Luppescu
On Tue, 2011-08-16 at 12:10 -0500, Stuart Luppescu wrote: > but when I use the ifelse() as above, I get this: >[,1] [,2] [,3] [,4] > [1,] 0.0417 0.0417 0.0417 0.0417 > [2,] 0. 0. 0. 0. Oh, I see. ifelse() returns a value

Re: [R] calibration curve for cph()

2011-08-16 Thread array chip
Oops, thank for reminding. I found that an in-house package interfered with rms package, which caused the error. Thanks David! John - Original Message - From: David Winsemius To: array chip Cc: Frank Harrell ; "r-help@r-project.org" Sent: Tuesday, August 16, 2011 11:27 AM Subject

Re: [R] calibration curve for cph()

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 1:57 PM, array chip wrote: Dear Frank, Thanks for suggesting val.surv() function from rms package. It's exactly what I need. I tried the example on the help page and tweak towards to my situation, but got an error message. Could you suggestion what went wrong? It is

[R] What's your favourite R book that doesn't have R in the title?

2011-08-16 Thread Paul Miller
Hello All,   Recently, I discovered that there are appear to be some good R related books that don't have R in the title. For example, I'm currently reading Gellman and Hill's book Data Analysis using Regression and Multilevel/Hierarchical Models. The book uses R (and BUGS) but doesn't appear to

Re: [R] convert an xml object into a list on R 2.13

2011-08-16 Thread Duncan Temple Lang
Hi Samuel The xmlToList() function is still in the XML package. I suspect you are making some simple mistake like not loading the XML package or haven't installed it or are not capitalizing the name of the function correctly (you refer the xml package rather than by its actual name). You haven'

Re: [R] Limit when reading in file?

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 1:33 PM, Sarah Goslee wrote: Hi Noah, On Tue, Aug 16, 2011 at 1:25 PM, Noah Silverman > wrote: Hello, I'm trying to read in a fairly large file into R, and am getting an odd error (65000 rows, 37 columns) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,

Re: [R] calibration curve for cph()

2011-08-16 Thread array chip
Dear Frank, Thanks for suggesting val.surv() function from rms package. It's exactly what I need. I tried the example on the help page and tweak towards to my situation, but got an error message. Could you suggestion what went wrong? library(rms) set.seed(123)  # so can reproduce re

Re: [R] Write vector/matrix in a loop

2011-08-16 Thread Ista Zahn
Hi, On Tue, Aug 16, 2011 at 1:31 PM, kokavolchkov wrote: > Hello! > > I'm trying to *save values* (*row and col*) in two matrices(1,m) or vectors. > I have a loop, where a get these values: > > for(i in 144){ >        for(j in 73){ >                if(B4[i,j]==1){ # B4 is a matrix(73, 144) >    

[R] Write vector/matrix in a loop

2011-08-16 Thread kokavolchkov
Hello! I'm trying to *save values* (*row and col*) in two matrices(1,m) or vectors. I have a loop, where a get these values: for(i in 144){ for(j in 73){ if(B4[i,j]==1){ # B4 is a matrix(73, 144) row <- B4[i-(i-1),j] col <-

Re: [R] Get significant codes from a model output fit with, GEE package

2011-08-16 Thread david oseguera montiel
Thank very much Dennis, I much appreciate your time and help. The example was very clear. Do you know if it is possible to get the variance do to the random effect or the correlation within random variable from the same reproducible example you post. I used to be able to get it when using a l

[R] FW: Bayesian Relative Survival Analysis in R?

2011-08-16 Thread #HE YAO FENG VINCENT#
Hi all, May i know does R has packages or code to run "Bayesian Relative Survival Analysis"? I have look through Bayesian Survival Analysis(2001) by Joseph George Ibrahim Ming-Hui Chen, Debajyoti Sinha , and would like to try out bayesian relative survival analysis in R. >From the cran project

Re: [R] Text wrap

2011-08-16 Thread Filoche
Thank you Mark for your help. It worked perfectly with 2 expression and mtext. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Text-wrap-tp3747574p3747884.html Sent from the R help mailing list archive at Nabble.com. __ R-

Re: [R] Fit Gompertz' curve'

2011-08-16 Thread Dennis Murphy
Hi: On Tue, Aug 16, 2011 at 7:07 AM, Silvano wrote: > Hi, > > I build a graph taking into account the times: 1, > 2,4,6,8,10,12,15,18,21,24,28,32 and 48. > > Be that the scale of the X axis does not look right. It seems equidistant. > (graph attached) (a) No graph came through. See the Posting G

Re: [R] postscript( does not save the plot

2011-08-16 Thread Marc Schwartz
On Aug 16, 2011, at 12:32 PM, Alaios wrote: > Dear all, > I am using the following code to write the plot to an eps format > > postscript(file="test.eps",horizontal=FALSE) > > boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],na

Re: [R] postscript( does not save the plot

2011-08-16 Thread Sarah Goslee
Hi, On Tue, Aug 16, 2011 at 1:32 PM, Alaios wrote: > Dear all, > I am using the following code to write the plot to an eps format > > postscript(file="test.eps",horizontal=FALSE) > > boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:5

Re: [R] Assignment working differently inside ifelse()

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 1:10 PM, Stuart Luppescu wrote: Hello all, I need to extract rows and columns from a data frame and put them in a matrix. In some cases, there are no rows in the data frame meeting the selection criteria. For those rows I want to put a row of 0's in the matrix. Here's my c

Re: [R] Limit when reading in file?

2011-08-16 Thread Sarah Goslee
Hi Noah, On Tue, Aug 16, 2011 at 1:25 PM, Noah Silverman wrote: > Hello, > > I'm trying to read in a fairly large file into R, and am getting an odd error > (65000 rows, 37 columns) > > Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : >  line 25628 did not have 37 el

[R] postscript( does not save the plot

2011-08-16 Thread Alaios
Dear all, I am using the following code to write the plot to an eps format postscript(file="test.eps",horizontal=FALSE) boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c

Re: [R] Bayesian Relative Survival Analysis in R?

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 10:48 AM, #HE YAO FENG VINCENT# wrote: Hi all, May i know does R has packages or code to run "Bayesian Relative Survival Analysis"? I have look through Bayesian Survival Analysis(2001) by Joseph George Ibrahim

[R] Limit when reading in file?

2011-08-16 Thread Noah Silverman
Hello, I'm trying to read in a fairly large file into R, and am getting an odd error (65000 rows, 37 columns) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 25628 did not have 37 elements That line DOES have 37 elements. As A test, I tried deleting it, a

Re: [R] ggplot - some questions concerning histograms

2011-08-16 Thread Dennis Murphy
Hi: On Tue, Aug 16, 2011 at 5:48 AM, Johannes Radinger wrote: > Hello, > > I am a beginner with ggplot and after doing simple graphs (histogram, > segments etc.) > some questions came up: > > 1) I tried to do a histogram, but nothing is displayed although it works with > another vector. > I thi

[R] Assignment working differently inside ifelse()

2011-08-16 Thread Stuart Luppescu
Hello all, I need to extract rows and columns from a data frame and put them in a matrix. In some cases, there are no rows in the data frame meeting the selection criteria. For those rows I want to put a row of 0's in the matrix. Here's my clumsy code: tab1.m1 <- matrix(0, nrow=2, ncol=4) tab1.m1

Re: [R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Berend Hasselman
Newbie wrote: > > I used: > marketdata <- read.csv(file="S&P 500 calls, jan-jun 2010.csv", > header=TRUE, sep=";") > after changing my directory to where the file is saved. > The data imported should be correct. > The spot is equal to S0, I typed it double in the post, sorry for that. > So S0

Re: [R] Filtering a table

2011-08-16 Thread Dennis Murphy
Hi: You're in the neighborhood, but not quite there. >> dbhmean <- mean (exp1 [time==575 & species ==1]) This doesn't work because exp1 is a data frame, which has both rows and columns. You want to select the *rows* for which time = 575 and species = 1, so you either need to put a comma after sp

[R] Bayesian Relative Survival Analysis in R?

2011-08-16 Thread #HE YAO FENG VINCENT#
Hi all, May i know does R has packages or code to run "Bayesian Relative Survival Analysis"? I have look through Bayesian Survival Analysis(2001) by Joseph George Ibrahim Ming-Hui Chen, Debajyoti Sinha , and would like to try out bayesian relative survival analysis in R. >From http://cran.r-pro

Re: [R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Newbie
I used: marketdata <- read.csv(file="S&P 500 calls, jan-jun 2010.csv", header=TRUE, sep=";") after changing my directory to where the file is saved. The data imported should be correct. The spot is equal to S0, I typed it double in the post, sorry for that. So S0 = 1136.03 is the spot -- View t

Re: [R] Text wrap

2011-08-16 Thread Marc Schwartz
On Aug 16, 2011, at 10:39 AM, Filoche wrote: > Hi everyone. > > I have a long label that I would like to split. I found that I could use > "strwrap" for simple text. However, this is not working with this label: > > str = expression(paste("< 20 µm phytoplankton ","(cells · ",mL^-1,")")) > > pl

Re: [R] Text wrap

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 11:39 AM, Filoche wrote: Hi everyone. I have a long label that I would like to split. I found that I could use "strwrap" for simple text. However, this is not working with this label: plot(, ylab = strwrap(str,20),...) I suspect this is because I'm using "express

[R] getting names of dimnames of xtabs into xtable latex output

2011-08-16 Thread Juliet Hannah
In R, the output of xtabs displays the names of the dimnames. In the example below, these are "change_diet" and "mydiet". Is there a way to have xtable incorporate these names directly into the latex output. Thanks for your help. table2 <- structure(c(26, 0, 40, 0, 10, 0, 188, 0, 281, 0), .Dim =

Re: [R] exponential model with decreasing

2011-08-16 Thread Ben Bolker
Komine yahoo.fr> writes: > I try to do an exponential model with decreasing. In my data, there is no > data missing but there negative values. I adapted this following code whose > the origin code comes from in this forum: > Regress<-read.table("C:\\Users\\Regression.csv",sep=";",dec=",",header=T

Re: [R] p.adjust problem

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 11:17 AM, m1ch...@gmx-topmail.de wrote: Hi, When I use the following code I get two different results, even though n is length(p) by default. - pvals <- c(5.722385e-02, NA, 1.018087e-01) p.adjust(pvals, method="bonfer

[R] convert an xml object into a list on R 2.13

2011-08-16 Thread Samuel Le
Hi, I am manipulating xml objects using the package xml. With the version 2.10.1 this package included the function xmlToList that was converting the xml into a list straight away. This function seems to have gone when I moved to 2.13.0. Does someone has an equivalent for it? Thanks, S

Re: [R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Berend Hasselman
Newbie wrote: > > Dear R-users > > I am trying to find a value for the risk free rate minimizing the > difference between a BS call value with impl. volatilities minus the > market price of a call (assuming this is just the average bid ask price) > > Here is my data: > > http://r.789695.n4.nab

[R] Text wrap

2011-08-16 Thread Filoche
Hi everyone. I have a long label that I would like to split. I found that I could use "strwrap" for simple text. However, this is not working with this label: str = expression(paste("< 20 µm phytoplankton ","(cells · ",mL^-1,")")) plot(, ylab = strwrap(str,20),...) I suspect this is because

[R] exponential model with decreasing

2011-08-16 Thread Komine
Hi everybody, I try to do an exponential model with decreasing. In my data, there is no data missing but there negative values. I adapted this following code whose the origin code comes from in this forum: Regress<-read.table("C:\\Users\\Regression.csv",sep=";",dec=",",header=TRUE) Regress f <- f

[R] p.adjust problem

2011-08-16 Thread m1ch43l
Hi, When I use the following code I get two different results, even though n is length(p) by default. - pvals <- c(5.722385e-02, NA, 1.018087e-01) p.adjust(pvals, method="bonferroni") p.adjust(pvals, method="bonferroni", n=length(pvals))

[R] Bayesian Relative Survival Analysis in R?

2011-08-16 Thread #HE YAO FENG VINCENT#
Hi all, May i know does R has packages or code to run "Bayesian Relative Survival Analysis"? I have look through Bayesian Survival Analysis(2001) by Joseph George Ibrahim, Ming-Hui Chen

[R] exponential with decreasing

2011-08-16 Thread Komine
Hi everybody, I try to do an exponential model with decreasing. In my data, there is no data missing but there negative values. I adapted this following code whose the origin code comes from in this forum: Regress<-read.table("C:\\Users\\Regression.csv",sep=";",dec=",",header=TRUE) Regress f <-

Re: [R] density plot with frequency units

2011-08-16 Thread r student
Let me ask another way. Is there a way to create a histogram with a fitted line, but without bars? Or, perhaps draw the bars with invisible lines? Thanks. On Tue, Aug 16, 2011 at 7:29 AM, Jeff Newmiller wrote: > This is a nonsensical request. It is like saying you want to plot the speed > of

[R] Calibrating the risk free interest rate using nlminb

2011-08-16 Thread Newbie
Dear R-users I am trying to find a value for the risk free rate minimizing the difference between a BS call value with impl. volatilities minus the market price of a call (assuming this is just the average bid ask price) Here is my data: http://r.789695.n4.nabble.com/file/n3747509/S%26P_500_calls

[R] Copulas and three vectors

2011-08-16 Thread Jakub Mikians
Hi i have a question about "copula" package ( http://cran.r-project.org/web/packages/copula/copula.pdf , http://www.jstatsoft.org/v21/i04/paper ) Using copulas, I want to generate three random vectors V1, V2 and V3, where both pairs (V1, V2) and (V1,V3) have the same dependency structure, defined

Re: [R] generalized inverse using matinv (Design)

2011-08-16 Thread Doran, Harold
Frank, It is very rare that one needs to ever invert a matrix. This is particularly true if you are trying to solve a linear system of equations. Rather than offering advice to you on how to compute the inverse, can you indicate what you're trying to accomplish in the end? Maybe we can offer be

[R] Problems installing SJava

2011-08-16 Thread Luis Felipe Parra
Hello, I am trying to install SJava but I haven't been able to complete it successfully. I have tried to install it from bioconductor using the followin code and got the following output: > source("http://www.bioconductor.org/biocLite.R";) BioC_mirror = http://bioconductor.org Change using chooseB

Re: [R] generalized inverse using matinv (Design)

2011-08-16 Thread David Winsemius
On Aug 16, 2011, at 10:15 AM, Frank Paetzold wrote: i am trying to use matinv from the Design package Which has been replaced by the rms package (about 2 years ago). to compute the generalized inverse of the normal equations of a 3x3 design via the sweep operator. That is, for the linear m

[R] to search the tree using the branch and bound mathod!!!

2011-08-16 Thread jiliguala
hi, R users i have encountered a problem, i want to make a clusterring tree, than do the searching through the tree using "branch and bound" method. here is the code to make the tree, thanks for any ideas... d <- dist(data, method = "euclidean") h1 <- hclust(d, method="ward") plot(h1)

[R] Unusual separators

2011-08-16 Thread Matt Curcio
Hi all, I have a list that I got from a web page that I would like to crunch. Unfortunately, the list has some unusual separators in it. I believe the columns are separated by 1 space and 1 tab. I tried to insert this into the read.table( ..., sep=" \t", ...) but got an error that said something

Re: [R] density plot with frequency units

2011-08-16 Thread Jeff Newmiller
This is a nonsensical request. It is like saying you want to plot the speed of a falling object but you want the units of speed to be meters. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Li

Re: [R] deSolve, extracting variable values from inside ode function

2011-08-16 Thread Berend Hasselman
jamaas wrote: > > I'm just getting to grips with using ode function and have used the > examples and vignettes to produce a small model of a one-pool, > michaelis-menten, enzyme kinetic reaction. The rate of flux of substrate > into pool A is constant (fluxoa) however the rate of flux out of p

[R] density plot with frequency units

2011-08-16 Thread r student
I would like to create a kernal density plot, but rather than show density units on the vertical axis I would like frequencies. I know histograms do this but I don't want the bars, just the density curve. Thanks! __ R-help@r-project.org mailing list h

[R] generalized inverse using matinv (Design)

2011-08-16 Thread Frank Paetzold
i am trying to use matinv from the Design package to compute the generalized inverse of the normal equations of a 3x3 design via the sweep operator. That is, for the linear model y = µ + x1 + x2 + x1*x2 where x1, x2 are 3-level factors and dummy coding is being used the matrix to be inverted i

Re: [R] Regression - how to deal with past values?

2011-08-16 Thread Mark Difford
On Aug 16, 2011 Eduardo M. A. M.Mendes wrote: > Can I gather from your email that there is nothing available on R that > deals > with dynamic models (k-step ahead and free-run)? Eduardo, There may be others, but try package dlm (Bayesian and Likelihood Analysis of Dynamic Linear Models) by Giov

Re: [R] Font size R

2011-08-16 Thread Filoche
Thank you sir for your help. I'll try to reset cex =1. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Font-size-R-tp3745762p3747271.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

  1   2   >