Re: [R] How to install Defaults package offline

2010-04-10 Thread Prof Brian Ripley
On Fri, 9 Apr 2010, dbonneau wrote: Hi, I just installed R software on my machine which is not supposed to have an internet access. I installed several package that I need, which are quantmod, xts, TTR etc. When I typed require(quantmod), I get Error: package 'Defaults' could not be loaded.

Re: [R] [stats-rosuda-devel] How to update JGR

2010-04-10 Thread Simon Urbanek
On Apr 9, 2010, at 6:10 PM, mau...@alice.it mau...@alice.it wrote: I recently updated R on Linus/SuSE 11.1 I complained because no on-line help was available from JGR after R update. I was told to update JGR as well. How can I do that ? I installed JGR on SuSE three times in the past with

Re: [R] Ranking correlation with R

2010-04-10 Thread Jim Lemon
On 04/10/2010 01:22 AM, David Nemer wrote: Hey Everyone, Im fresh new in R, and Im supposed to write a code to give me a correlation between two rankings. So I have two ranking lists, which contain file names, e.g.: Ranking list 1: file1.java file3.java file2.java Ranking list 2: fiile2.java

Re: [R] interpolating between lat/long position data with time

2010-04-10 Thread Paul Hiemstra
cbarcelo wrote: Hello, I am currently working with satellite tracking data for an organism with irregularly spaced location data in space and time (point data is occasionally spaced by 1-10 days). I have 4 columns of data, Lat, Long, Date, Time. I would like to linearly interpolate my data set

Re: [R] Ranking correlation with R

2010-04-10 Thread Gabor Grothendieck
Try this: A - c(file1.java, file3.java, file2.java) B - c(file2.java, file4.java, file1.java) cor(A, B, method = spearman) [1] 0.5 On Fri, Apr 9, 2010 at 11:22 AM, David Nemer davidne...@gmail.com wrote: Hey Everyone, Im fresh new in R, and Im supposed to write a code to give me a

Re: [R] Brier's score for bootstrap sample (coxph)

2010-04-10 Thread Frank E Harrell Jr
paaventhan jeyaganth wrote: Dear all, How can i get brier's score for the bootsrap sample for survival analysis. this are the code i am using for the validation. f1 - cph(Surv(time,dead ) ~ strata(x1)+strata(x2)+strata(x3), x=TRUE, y=TRUE, surv=TRUE, time.inc=12, data=new)

[R] minimization function

2010-04-10 Thread li li
Hi all, I am trying to minimize the quardratic form w'Aw, with certain constraints. In particular, (1) A=(a_{ij}) is n by n matrix and it is symmetric positive definite, a_{ii}=1 for all i; and 0a_{ij}1 for i not equal j. (2) w'1=n; (3) w_{i}=0 Analytically, for

Re: [R] str: how to use no list recursively?

2010-04-10 Thread Henrique Dallazuanna
Try this: cat(gsub(:List of .*, , capture.output(str(x, no.list = TRUE))), sep = '\n') On Fri, Apr 9, 2010 at 11:11 PM, Jeff Brown dopethatwantsc...@yahoo.com wrote: Hi, In the help file for str(), the following line appears: no.list         logical; if true, no ‘list of ...’ nor the

Re: [R] use read.table for a partial reading

2010-04-10 Thread Robert Baer
- Original Message - From: Covelli Paolo pcove...@tele2.it To: r-help@r-project.org Sent: Thursday, April 08, 2010 9:05 AM Subject: [R] use read.table for a partial reading Hi everyone, I've got a matrix data with 20 variables (V1, V2, V3, ...) and 215 rows (observations). I'm

Re: [R] minimization function

2010-04-10 Thread Paul Smith
On Sat, Apr 10, 2010 at 4:58 PM, li li hannah@gmail.com wrote:    I am trying to minimize the quardratic form w'Aw, with certain constraints. In particular,    (1) A=(a_{ij}) is n by n matrix and it is symmetric positive definite,        a_{ii}=1 for all i;        and 0a_{ij}1 for i not

Re: [R] use read.table for a partial reading

2010-04-10 Thread Henrique Dallazuanna
Try this also: your_data - read.table('your_file.txt', colClasses = c('character', 'character', rep(NULL, 18))) On Thu, Apr 8, 2010 at 11:05 AM, Covelli Paolo pcove...@tele2.it wrote: Hi everyone, I've got a matrix data with 20 variables (V1, V2, V3, ...) and 215 rows (observations). I'm

Re: [R] minimization function

2010-04-10 Thread Paul Smith
On Sat, Apr 10, 2010 at 5:13 PM, Paul Smith phh...@gmail.com wrote:    I am trying to minimize the quardratic form w'Aw, with certain constraints. In particular,    (1) A=(a_{ij}) is n by n matrix and it is symmetric positive definite,        a_{ii}=1 for all i;        and 0a_{ij}1 for i not

Re: [R] Read data in sequences

2010-04-10 Thread Peter Ehlers
On 2010-04-09 10:04, Dieter Menne wrote: RockO wrote: I tried to find a solution in the search list, but I cannot find it. I would like to read a .txt file with, let say, three variables, with two of which have repeated values in a number a columns. The variables: Treat, x1, x2. The values:

Re: [R] Read data in sequences

2010-04-10 Thread Gabor Grothendieck
Try this. The data portion DF[-1] is transposed forming length 2 columns composed of successive elements of DF rows. This is then transposed back and the id's added in: # read in Lines - A 2.5 3.4 2.7 5.6 5.7 5.4 10.1 9.4 B 5.3 5.4 6.5 7.5 1.3 4.5 10.5 4.1 DF -

Re: [R] I can´t run the example shown in the inline pa ckage

2010-04-10 Thread Uwe Ligges
On 09.04.2010 17:43, satu wrote: Dear Romain, you are right. Apologies, here is the complete result from your script: code- '#includeRdefines.h\nSEXP f(){\n return R_NilValue ; }' writeLines( code, test.c ) system( R CMD SHLIB test.c ) gcc -IC:/R/R-210~1.1/include-O3 -Wall

[R] writing function help

2010-04-10 Thread casperyc
Hi, I have written a function, ( or 2 functions) becasue there are only tiny difference, One of them has lines == #c2 (price.mat) call option price c2=c( max(S.mat[1,3]-K,0), max(S.mat[2,3]-K,0), max(S.mat[3,3]-K,0) ) (some lines) list( Stock Value=round(S.mat,dp),

Re: [R] fill in values between rollapply

2010-04-10 Thread Brad Patrick Schneid
Dennis: I had never used the rep() function and that works out great, thank you. Brad -- View this message in context: http://n4.nabble.com/fill-in-values-between-rollapply-tp1816885p1835513.html Sent from the R help mailing list archive at Nabble.com.

[R] simple data import of .csv

2010-04-10 Thread doconnor
Hello, I am a complete beginner to R. I use a mac and want to import and read a .csv dataset stored as .csv file. I understand I eventually enter - read.csv(size.csv, header=T) , but I can't get R to find my file, which is called size.csv and located

Re: [R] simple data import of .csv

2010-04-10 Thread William Revelle
Hello, I am a complete beginner to R. I use a mac and want to import and read a .csv dataset stored as .csv file. I understand I eventually enter - read.csv(size.csv, header=T) , but I can't get R to find my file, which is called size.csv and located

Re: [R] minimization function

2010-04-10 Thread li li
Hi, thanks for the reply. A will be a given matrix satisfying condition 1. I want to find the vector w that minimizes the quadratic form. w satisfies condition 2. 2010/4/10 Paul Smith phh...@gmail.com On Sat, Apr 10, 2010 at 5:13 PM, Paul Smith phh...@gmail.com wrote: I am trying to

Re: [R] minimization function

2010-04-10 Thread Gabor Grothendieck
Check out the quadprog package. On Sat, Apr 10, 2010 at 5:36 PM, li li hannah@gmail.com wrote: Hi, thanks for the reply.   A will be a given matrix satisfying condition 1. I want to find the vector w that minimizes the quadratic form. w satisfies condition 2. 2010/4/10 Paul Smith

Re: [R] Rsge: recursive parallelization

2010-04-10 Thread Martin Morgan
On 04/09/2010 08:52 AM, Peter Danenberg wrote: In principle, I'd like to be able to do something like this: sge.parLapply(seq(10), function(x) parLapply(seq(x), function(x) x^2)) I'm not sure that's such a good principle! It seems like it would be hard to think about the tasks that are

Re: [R] fill in values between rollapply

2010-04-10 Thread Gabor Grothendieck
Here are two solutions. Assuming x is a zoo object both return zoo objects: 1. rollapply with na.pad and na.locf: r - rollapply(x, 5, mean, by = 5, align = left, na.pad = TRUE) na.locf(r) 2. or try this which does not use rollapply at all but assumes x is 1 dimensional: n - length(x) a

[R] .Call function crashes initializing matrix

2010-04-10 Thread Erik Wright
Hello, I have a C function that I call from R using .Call. I recently discovered a bug in my code, and I am not sure if it is a problem with what I am doing in C or if it has something to do with my use of .Call. I have narrowed my problem down to these two C statements: int size = 5000;

[R] selecting certain columns or rows from a .csv

2010-04-10 Thread doconnor
Hello, I'm using read.csv(filename,header=TRUE) but need to extract just certain columns or rows from the file. Much thanks. -- View this message in context: http://n4.nabble.com/selecting-certain-columns-or-rows-from-a-csv-tp1835692p1835692.html Sent from the R help mailing list archive at

Re: [R] simple data import of .csv

2010-04-10 Thread doconnor
Perfect, thank you!! -- View this message in context: http://n4.nabble.com/simple-data-import-of-csv-tp1835620p1835678.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] simple data import of .csv

2010-04-10 Thread doconnor
A related question: how do I make R return only one column or row of the .csv file. For example, I have about 1000 rows and three columns - can I import only certain rows or columns, like just column 1? Thank you!!! -- View this message in context:

Re: [R] simple data import of .csv

2010-04-10 Thread jim holtman
For that size file, it is the easiest to read in the entire file and then index just the portion that you want. On Sat, Apr 10, 2010 at 5:38 PM, doconnor oconnor.davi...@gmail.com wrote: A related question: how do I make R return only one column or row of the .csv file. For example, I have

Re: [R] selecting certain columns or rows from a .csv

2010-04-10 Thread jim holtman
?read.csv colCLasses nrows On Sat, Apr 10, 2010 at 6:11 PM, doconnor oconnor.davi...@gmail.com wrote: Hello, I'm using read.csv(filename,header=TRUE) but need to extract just certain columns or rows from the file. Much thanks. -- View this message in context:

[R] writing function (plot problem)

2010-04-10 Thread casperyc
Hi, === x=rnorm(20) y=rnorm(20) t=lm(y~x) plot(t) === you will get click or hit enter to next page... how do I write a function to archieve this ? say plot(x,y) then pause, wait plot(y,x) Thanks! casper -- View this message in context:

Re: [R] writing function (plot problem)

2010-04-10 Thread jim holtman
?devAskNewPage On Sat, Apr 10, 2010 at 7:49 PM, casperyc caspe...@hotmail.co.uk wrote: Hi, === x=rnorm(20) y=rnorm(20) t=lm(y~x) plot(t) === you will get click or hit enter to next page... how do I write a function to archieve this ? say

Re: [R] .Call function crashes initializing matrix

2010-04-10 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erik Wright Sent: Saturday, April 10, 2010 3:23 PM To: r help Subject: [R] .Call function crashes initializing matrix Hello, I have a C function that I call from R using

[R] plotting rpart objects, text.rpart, fancy option

2010-04-10 Thread Claudia Penaloza
I have created plots of rpart objects with the fancy option for text.rpart (fancy creates ellipses and rectangles and labels branches with splitting criteria). The ellipses and rectangles are supposed to interrupt the tree lines (as seen in Therneau and Atkinson 1997, page 48, Fig. 18,

[R] using BLAT in r

2010-04-10 Thread Fahim Md
Does anyone know how to use BLAT(Blast-Like alignment tool) in R? Thanks and regards. -- Fahim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Expectation of E(x^1/2)

2010-04-10 Thread Haneef Anver
Hi all, I am trying to find the expectation of x^1/2 where x~N(a,b) ( Normal with mean a and variance b). Any feedback would be highly appreciated. Have great day ! Haneef [[alternative HTML version deleted]] __

Re: [R] Expectation of E(x^1/2)

2010-04-10 Thread Sunny Srivastava
Dear Haneef, Pls see if this suits your requirement. sim.norm = rnorm(1,mean=a,sd=sqrt(b)) mean.est = mean(sqrt(sim.norm)) Thx S. On Sat, Apr 10, 2010 at 9:31 PM, Haneef Anver hane...@yahoo.com wrote: Hi all, I am trying to find the expectation of x^1/2 where x~N(a,b) ( Normal with

Re: [R] selecting certain columns or rows from a .csv

2010-04-10 Thread Fahim
dataFile = read.csv(filename.csv,header= TRUE); #suppose u want col 1, col 9 and col 15 col1 = 1; col9 = 9; col15 = 15; modifiedDataFile1 = dataFile[,c(col1, col9, col15)]; #if u want rows from 1-100 and then 1000-5000 modifiedDataFile2 = dataFile[c(1:100, 1000:5000), ]; #If u want to select

[R] using BLAT in r

2010-04-10 Thread Fahim
I am trying to use blat in R. I couldn't find any package in CRAN or bioconductor. I downloaded the windows executable from Jim Kent's (from ucsc) webpage. I was wondering how to use/call these executables or functions embedded in these executables. I am seeking for some direction or some

Re: [R] Expectation of E(x^1/2)

2010-04-10 Thread Charles C. Berry
On Sat, 10 Apr 2010, Haneef Anver wrote: Hi all, I am trying to find the expectation of x^1/2 where x~N(a,b) ( Normal with mean a and variance b). Any feedback would be highly appreciated. Start by constructing plots of x vs Re(sqrt(x)) and x vs Im(sqrt(x)) for -1 x 1. Do it by hand.

Re: [R] Expectation of E(x^1/2)

2010-04-10 Thread Ben Bolker
Haneef Anver haneef9 at yahoo.com writes: I am trying to find the expectation of x^1/2 where x~N(a,b) ( Normal with mean a and variance b). Any feedback would be highly appreciated. I have no idea at the moment how to start doing this analytically, but is this at all helpful?

Re: [R] Expectation of E(x^1/2)

2010-04-10 Thread Ravi Varadhan
Chuck showed how to do this: fn - function(x) sqrt(x) * dnorm(x) integrate(fn, 0, Inf) 0.4110895 with absolute error 4.7e-05 So the (almost) exact answer is 0.4110895 + 1i * 0.4110895 Ravi. Ravi Varadhan, Ph.D.

Re: [R] Expectation of E(x^1/2)

2010-04-10 Thread Ben Bolker
And Mathematica says In[2]:= 1/Sqrt[2 Pi] Integrate[Exp[-x^2/2] Sqrt[x],{x,0,Infinity}] 3 Gamma[-] 4 Out[2]= - 3/4 2Sqrt[Pi] (I suppose there's probably a change-of-variables trick to do this ...) in R: