Re: [R] Searching for a pattern within a vector

2012-02-24 Thread Petr Savicky
On Fri, Feb 24, 2012 at 01:00:00PM +0530, Apoorva Gupta wrote: Dear R users, I have a data.frame as follows a b c d e [1,] 1 1 1 0 0 [2,] 1 1 0 0 0 [3,] 1 1 0 0 0 [4,] 0 1 1 1 1 [5,] 0 1 1 1 1 [6,] 1 1 1 1 1 [7,] 1 1 1 0 1 [8,] 1 1 1 0 1 [9,] 1 1 1 0 0 [10,] 1 1 1 0

Re: [R] Searching for a pattern within a vector

2012-02-24 Thread Berend Hasselman
On 24-02-2012, at 08:30, Apoorva Gupta wrote: Dear R users, I have a data.frame as follows a b c d e [1,] 1 1 1 0 0 [2,] 1 1 0 0 0 [3,] 1 1 0 0 0 [4,] 0 1 1 1 1 [5,] 0 1 1 1 1 [6,] 1 1 1 1 1 [7,] 1 1 1 0 1 [8,] 1 1 1 0 1 [9,] 1 1 1 0 0 [10,] 1 1 1 0 0 Within these 4

Re: [R] JGR Segmentation fault

2012-02-24 Thread dberringer
Ok. So I'm a little closer to figuring this thing out. I didn't realize I needed to run the javareconf command as root like so. sudo R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers I'm not getting the permission issue anymore but I'm still getting the

[R] R package documentation

2012-02-24 Thread Matyas Sustik
Hi All, I am asking for some clarification on R package documentation. The Writing R extension manual did not make this clear for me the following: 1. How to document a dataset? I know the file format from the doc, but I cannot figure out what file to put that info in. I keep getting

[R] tcl tk command function with arguments ??

2012-02-24 Thread Alexander
Hello, I am using R 2.11.1 under Windows XP. I would like to know if its possible to use a function with arguments as a command in tcl tk. For example require(tcltk) PressedOK - function() { tkmessageBox(message=You pressed OK!) } tt - tktoplevel() OK.but -

[R] RServe

2012-02-24 Thread Ajay Askoolum
One line of the RServe documentation (for Java, which I do not know) is: Rconnection c = new Rconnection(); 1. Is Rserve a COM or ActiveX object? If affirmative, what is the ProgId (or clsid)? 2. If Rserve is not an ActiveX Object, does Java (like C#) require a reference to the EXE or DLL

Re: [R] how to draw crossing circles to show relationship?

2012-02-24 Thread S Ellison
Try RSiteSearch(Venn diagram) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Guang Dai Sent: 23 February 2012 22:30 To: r-help@r-project.org Subject: [R] how to draw crossing circles to show relationship? Dear list,

Re: [R] Problems with Cosine Similarity using library(lsa)

2012-02-24 Thread A J
THANKS a lot Tad! It is just what I needed to calculate cosine similarities on my matrix. Best, AJ Date: Thu, 23 Feb 2012 12:14:43 -0800 From: tad.dal...@drakeresearchlab.com To: r-help@r-project.org Subject: Re: [R] Problems with Cosine Similarity using library(lsa) The as.matrix

Re: [R] multhist weird behavior/ xlabels wrong

2012-02-24 Thread Jim Lemon
On 02/24/2012 09:30 AM, Laura Matrajt wrote: Hi, I found some weird behavior of the function multhist in the plotrix package and I would like to ask you about it: so, it works well to put two histograms next to each other, but I don't understand the breaks… so for example, library(plotrix)

Re: [R] import .csv file into R

2012-02-24 Thread Marion Wenty
Hi Michael, thanks a lot for the additional tips! So far it all has worked! Marion 2012/2/17 Marion Wenty marion.we...@gmail.com Hi Michael and Rui, thanks a lot for the tips. It worked with both your suggestions! I also found out, that this problem only exists if I put header=T. Thanks

[R] gsub to manipulate characters

2012-02-24 Thread syrvn
Hello, from a vector of strings I want to delete everything after the _ v - c(AAA_BB, FF_MM) gsub(_*, , v) [1] AAABB FFMM but should be [1] AAA FF Why does * not work? Even perl=TRUE does not give me the right result Man thanks! -- View this message in context:

Re: [R] gsub to manipulate characters

2012-02-24 Thread Berend Hasselman
On 24-02-2012, at 12:48, syrvn wrote: Hello, from a vector of strings I want to delete everything after the _ v - c(AAA_BB, FF_MM) gsub(_*, , v) [1] AAABB FFMM but should be [1] AAA FF Why does * not work? Even perl=TRUE does not give me the right result gsub(_.*$, , v)

Re: [R] gsub to manipulate characters

2012-02-24 Thread syrvn
cool that works! thanks a lot :) -- View this message in context: http://r.789695.n4.nabble.com/gsub-to-manipulate-characters-tp4416939p4416961.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] R package documentation

2012-02-24 Thread Ista Zahn
Hi, On Friday, February 24, 2012 02:52:32 AM Matyas Sustik wrote: Hi All, I am asking for some clarification on R package documentation. The Writing R extension manual did not make this clear for me the following: 1. How to document a dataset? I know the file format from the doc, but I

Re: [R] How to download all packages and then install

2012-02-24 Thread Prof Brian Ripley
On Fri, 24 Feb 2012, Xiong Deng wrote: Hi, I tried to use the given rsync command to make the mirror twice. However, both failed, showing: rsync: read error: Connection reset by peer (104) rsync error: error in rsync protocol data stream (code 12) at io.c(515) rsync: connection unexpectedly

Re: [R] saving all data in r object

2012-02-24 Thread iriseekhout
Hi Uday, You could try to include 'write.table' in your loop and use paste to save every file separately like this: for ( i in 1:100) { data- read.table(file_s[i],header=TRUE,skip=55 ) latitude [i] - data[,6] longitude[i] - data[,7] time[i]- data[,8] temp[i ] -

[R] To define a function which includes two functions as arguments such as plot and text

2012-02-24 Thread Yashwanth M.R
Here is the two functions which I have used during my practice. *plot(Telco.rpart.METHOD.CLASS,compress=FALSE,uniform=TRUE) text(Telco.rpart.METHOD.CLASS,use.n = TRUE, cex = .75))* Telco.rpart.METHOD.CLASS is my rpart object of the method class. If I run this, *Telco.Rpart.PLOT.TEXT -

[R] mgcv: REML increase with new predictor

2012-02-24 Thread Greg Dropkin
hi Simon this follows on from the example where gcv increased unexpectedly with increasing basis dimension. I'm now looking at t2 tensor splines with REML, and find that the REML score can increase when adding a new predictor. Again, this seems odd. thanks Greg library(mgcv) set.seed(0)

Re: [R] Poblems wih EBImage

2012-02-24 Thread diyanah
hello, I think my EBImage is succesfully unpacked using R and I receive this message package 'EBImage' successfully unpacked and MD5 sums checked The downloaded packages are in C:\Users\Yana-Chan\AppData\Local\Temp\Rtmp7VFmH5\downloaded_packages but when I try to call the library, I

[R] code for mixed model in R?

2012-02-24 Thread jurgen_vercauteren
Dear I am analysing my data wit a mixed model. I used SAS but I want to redo the same analysis in R. Here the SAS code and what I wrote in R. It seems to work but the results are not the same. I don't know how to specify the class variable in R or specify the variance matrix. Can you please help

Re: [R] How to download all packages and then install

2012-02-24 Thread Xiong Deng
Hi, I tried to use the given rsync command to make the mirror twice. However, both failed, showing: rsync: read error: Connection reset by peer (104) rsync error: error in rsync protocol data stream (code 12) at io.c(515) rsync: connection unexpectedly closed (112150 bytes received so far)

Re: [R] Missing Data in Stepwise selection of Logistic regression

2012-02-24 Thread Michael Dewey
At 07:02 24/02/2012, Kawthar Alajmi wrote: Hi all, I am running Stepwise logistic regression and i have : 1- Multiple covatiates included in each model (No missing data) So there is no missing data on any covariate? 2- Genotype data (SNPs) about 500,000 . I partitioned the data to multiple

Re: [R] help filtering points from a scatterplot

2012-02-24 Thread Dallas
I believe this is what you want to do, though it may need tweaking. #Make up some data a=seq(1,100,by=1) b=runif(100,0,0.5) #Make a matrix matrix=cbind(a,b) #Subset the matrix based upon values of interest subsetmatrix=matrix[which(b0.1),] #Plot values

Re: [R] Schoenfeld residuals for a null model coxph

2012-02-24 Thread Terry Therneau
begin included message --- I have a coxph model like coxph(Surv(start, stop, censor) ~ x + y, mydata) I would like to calculate the Schoenfeld residuals for the null, i.e the same model where the beta hat vector (in practical terms, the coeff vector spat out by summary()) is constrained to

Re: [R] Improving performance of split-apply problem

2012-02-24 Thread Martin
Thank you!! Using lm.fit did the trick. 2012/2/23 R. Michael Weylandt michael.weyla...@gmail.com It looks like what you are doing is reasonably efficient: I do think there's a residuals element to the object returned by lm() so you could just call that directly (which will be just a little

Re: [R] saving all data in r object

2012-02-24 Thread R. Michael Weylandt
You have three problems: 1) You don't post with context 2) You have a (likely OS permissions) issue that keeps you from accessing the RData file 3) You can't put a whole bunch of data in a single element of an object (ie., you are trying to put a column of data in a single element of an object:

Re: [R] Poblems wih EBImage

2012-02-24 Thread Prof Brian Ripley
On Fri, 24 Feb 2012, diyanah wrote: hello, I think my EBImage is succesfully unpacked using R and I receive this message On Windows it seems, but EBImage is a Bioconductor package and they have their own lists. package 'EBImage' successfully unpacked and MD5 sums checked The downloaded

Re: [R] code for mixed model in R?

2012-02-24 Thread Ben Bolker
jurgen_vercauteren jurgen_vercauteren at hotmail.com writes: I am analysing my data wit a mixed model. I used SAS but I want to redo the same analysis in R. Here the SAS code and what I wrote in R. It seems to work but the results are not the same. I don't know how to specify the class

Re: [R] Advice on exploration of sub-clusters in hierarchical dendrogram

2012-02-24 Thread ilai
Inline: On Thu, Feb 23, 2012 at 8:23 PM, R. Michael Weylandt michael.weyla...@gmail.com michael.weyla...@gmail.com wrote: Inline: On Feb 23, 2012, at 6:20 PM, kosmo7 dnico...@hotmail.com wrote: Dear Elai, thank you very much for your suggestion. I tried cutting the dendrogram instead of

[R] data frame manipulation with condition

2012-02-24 Thread Arnaud Gaboury
Dear list, n00b question, but still can't find any easy answer. Here is a df: df-data.frame(cbind(x=c(AA,BB,CC,AA),y=1:4)) df x y 1 AA 1 2 BB 2 3 CC 3 4 AA 4 I want to modify this df this way : if df$x==AA then df$y=df$y*10 if df$x==BB then df$y=df$y*25 and so on with other

Re: [R] help with winbugs glm

2012-02-24 Thread Adan Jordan-Garza
Ok this makes a lot of sense, thank you very much Ilai! Cheers Guillermo On Fri, Feb 24, 2012 at 12:16 AM, ilai ke...@math.montana.edu wrote: On Thu, Feb 23, 2012 at 8:32 PM, Adan Jordan-Garza ajordangarza2...@my.fit.edu wrote: Hello Ilai, thank you very much for your response, can I

Re: [R] segfault when using data.table package in conjunction with foreach

2012-02-24 Thread Uwe Ligges
0. Read the posting guide! It tells you to 1. Do not cross post! 2. Do try a recent version of R and all packages you have in use. 3. If it still fails, send a reproducible example. Uwe Ligges On 23.02.2012 18:04, Matthew Keller wrote: Hi all, I'm trying to use the package read.table

Re: [R] data frame manipulation with condition

2012-02-24 Thread Uwe Ligges
On 24.02.2012 16:25, Arnaud Gaboury wrote: Dear list, n00b question, but still can't find any easy answer. Here is a df: Change df-data.frame(cbind(x=c(AA,BB,CC,AA),y=1:4)) to df - data.frame(x = c(AA,BB,CC,AA), y = 1:4) to make your object a sensible data.frame. df x y 1

Re: [R] To define a function which includes two functions as arguments such as plot and text

2012-02-24 Thread Uwe Ligges
On 24.02.2012 12:22, Yashwanth M.R wrote: Here is the two functions which I have used during my practice. *plot(Telco.rpart.METHOD.CLASS,compress=FALSE,uniform=TRUE) text(Telco.rpart.METHOD.CLASS,use.n = TRUE, cex = .75))* Telco.rpart.METHOD.CLASS is my rpart object of the method class. If

Re: [R] help with winbugs glm

2012-02-24 Thread Adan Jordan-Garza
Ohh! about the reference code for the categorical predictor, from the McCarthy book, Bayesian Methods for Ecology (ISBN978-0-521-85057-5) the following ANCOVA model has a Refuge as a categorical predictor with 3 levels coded as 1, 2 and 3. This is the cited model: model { a ~ dnorm(1.01, 24.826)

Re: [R] count.fields inconsistent with read.table?

2012-02-24 Thread Sam Steingold
* peter dalgaard cqn...@tznvy.pbz [2012-02-24 08:41:07 +0100]: On Feb 24, 2012, at 06:58 , Sam Steingold wrote: batch is a vector of lines returned by readLines from a NL-line-terminated file, here is the relevant section: = AA BB

Re: [R] data frame manipulation with condition

2012-02-24 Thread Arnaud Gaboury
TY Uwe, So I will have to write a line for each condition? Right? In fact I was trying to do something with apply in one line, but couldn't achieve any result. In fact, all my transformation will be multiplying one object by a specific number according to the value of df$x. Arnaud Gaboury  

Re: [R] data frame manipulation with condition

2012-02-24 Thread Uwe Ligges
On 24.02.2012 16:59, Arnaud Gaboury wrote: TY Uwe, So I will have to write a line for each condition? Right? In fact I was trying to do something with apply in one line, but couldn't achieve any result. In fact, all my transformation will be multiplying one object by a specific number

Re: [R] Advice on exploration of sub-clusters in hierarchical dendrogram

2012-02-24 Thread kosmo7
Ok, I was able to work it out finally. As I have been aided myself numerous times from posted questions by other users who have reached in the end a solution to their problem, I will put the code that worked for me for future googlers - it is certainly not optimal but it works: # Initial

[R] data frame manipulation with conditions

2012-02-24 Thread A2CT2 Trading
Dear list, n00b question, but still can't find any easy answer. Here is a df: df-data.frame(cbind(x=c(AA,BB,CC,AA),y=1:4)) df x y 1 AA 1 2 BB 2 3 CC 3 4 AA 4 I want to modify this df this way : if df$x==AA then df$y=df$y*10 if df$x==BB then df$y=df$y*25 and so on with other

[R] R CMD INSTALL fails where R CMD check succeeds.

2012-02-24 Thread Rob Steele
This is in a 64 bit CentOS 5.6 instance at Amazon AWS with R version 2.14.1 (2011-12-22). It happens on several packages: RMySQL, RODBC, FastICA. Many other packages install just fine. Here's an example error message: * installing *source* package 'RODBC' ... ** package 'RODBC' successfully

[R] Rugarch-Package - df of std

2012-02-24 Thread barb
Hey Guys, i want the degrees of freedom of the student-t distribution to be given out. Since, i only get the shape parameter, i wanted to ask for help. On one side i found the same parameter being used for the shape parameter and df. But df of a std. aren´t allowed to equal decimal numbers!?

Re: [R] data frame manipulation with condition

2012-02-24 Thread Sarah Goslee
I sent it to you and the list, as is standard practice. You must know in advance what level of your factor goes with what multiplicand. Use that information to set up the association. The order within your data frame is irrelevant, only the order R uses for factor levels is of importance. Sarah

Re: [R] data frame manipulation with condition

2012-02-24 Thread Arnaud Gaboury
df- data.frame(x = c(AA,BB,CC,AA,DD,DD), y = 1:6) mult - c(AA = 10, BB = 25,DD=15) df$y - df$y * mult[df$x] df x y 1 AA 10 2 BB 50 3 CC 45 4 AA 40 5 DD NA 6 DD NA My df is in fact much more longer than the chosen example shown here. It seems your tip didn't do the job. I am expecting

Re: [R] data frame manipulation with condition

2012-02-24 Thread Uwe Ligges
On 24.02.2012 17:36, Arnaud Gaboury wrote: df- data.frame(x = c(AA,BB,CC,AA,DD,DD), y = 1:6) mult- c(AA = 10, BB = 25,DD=15) df$y- df$y * mult[df$x] df x y 1 AA 10 2 BB 50 3 CC 45 4 AA 40 5 DD NA 6 DD NA My df is in fact much more longer than the chosen example shown here. It seems

Re: [R] data frame manipulation with condition

2012-02-24 Thread Sarah Goslee
You need, as I already suggested, to use a value of 1 for levels you don't want to change. mult - c(AA = 10, BB = 25, CC=1, DD=15) mult[df$x] AA BB CC AA DD DD 10 25 1 10 15 15 df$y * mult[df$x] AA BB CC AA DD DD 10 50 3 40 75 90 On Fri, Feb 24, 2012 at 11:36 AM, Arnaud Gaboury

[R] help with apply function for 3D array

2012-02-24 Thread C Lin
Dear R users, I am trying to use apply function on a 3D array (get rid of any loop) but wasn't successfull. Below is a toy example of what I am trying to do: refID_remNoCat = 1:30; s_remNoCat = sample(1:length(refID_remNoCat),size=length(refID_remNoCat)); s.sort_remNoCat =

Re: [R] data frame manipulation with condition

2012-02-24 Thread Arnaud Gaboury
OK Uwe, I understand, and I will be more explicit. Here is how could my df be: reported - structure(list(Product = structure(c(1L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 5L, 5L, 5L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 12L,

Re: [R] Aggregate with Function List ?

2012-02-24 Thread Eik Vettorazzi
Hi Michael, something like the following might be a starting point for aggregating data using arbitrary lists of functions: (it is lacking a method for data.frame objects) maggregate-function(...)UseMethod(maggregate) maggregate.default-function(x, FUN, ...){

Re: [R] help with winbugs glm

2012-02-24 Thread ilai
My apologies to R-list members, this discussion diverged and is no longer R related. Probably more fitting in one of the BUGS forums, but I keep cc ing for any future interested reader that stumbled upon this post in r-help. Now to the point. Thank you so much for the reference, I was not aware

Re: [R] Searching for a pattern within a vector

2012-02-24 Thread William Dunlap
A different approach to this problem is via convolutional filtering. f - function (x, pattern, tolerance = 1e-05) { # x is a numeric matrix (or vector or data.frame) of data, pattern is # a vector. This returns the number of times the pattern is found # in each column of x.

Re: [R] data frame manipulation with condition

2012-02-24 Thread Arnaud Gaboury
TY very much Sarah: your tip is doing the job: reported - structure(list(Product = structure(c(1L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 5L, 5L, 5L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 12L, 13L, 14L, 14L), .Label = c(CL,

Re: [R] data frame manipulation with condition

2012-02-24 Thread William Dunlap
Use mult[as.character(df$x)] instead of mult[df$x]. They are different when df$x is a factor and the character version is what you want. df- data.frame(x = c(AA,BB,CC,AA,DD,DD), y = 1:6) mult - c(AA = 10, BB = 25,DD=15) df$y - df$y * mult[as.character(df$x)] df x y 1 AA 10 2

Re: [R] data frame manipulation with condition

2012-02-24 Thread Sarah Goslee
On Fri, Feb 24, 2012 at 12:23 PM, William Dunlap wdun...@tibco.com wrote: Use mult[as.character(df$x)] instead of mult[df$x]. They are different when df$x is a factor and the character version is what you want. R will coerce a factor to character to perform the comparison; explicitly calling

Re: [R] help filtering points from a scatterplot

2012-02-24 Thread Vining, Kelly
Thanks for the suggestion, Tad, but that's not quite it. That is still taking a subset of the whole data set, so I am losing some of the x(Window) values. I need to be able to retain all of the x values (column a in your example), but not plot any points above. Maybe I need to construct a blank

Re: [R] data frame manipulation with condition

2012-02-24 Thread Arnaud Gaboury
In fact I need to use William tip: Use mult[as.character(df$x)] instead of mult[df$x]. Let's try again with a shorter df as example: The rule: if AA, then multiply y by 2, if BB multiply y by 5, if CC do nothing, if DD multiply by 2. Let's say day 1 I have df1: df1 - structure(list(x =

Re: [R] data frame manipulation with condition

2012-02-24 Thread Sarah Goslee
Whatever makes you happy. df1 - + structure(list(x = structure(c(1L, 2L, 2L, 3L), .Label = c(AA, + BB, CC), class = factor), y = 1:4), .Names = c(x, y + ), row.names = c(NA, -4L), class = data.frame) mult - c(AA=2,BB=5,CC=1,DD=2) df1$y * mult[df1$x] AA BB BB CC 2 10 15 4 df1$y *

Re: [R] R CMD INSTALL fails where R CMD check succeeds.

2012-02-24 Thread Prof Brian Ripley
On 24/02/2012 15:22, Rob Steele wrote: This is in a 64 bit CentOS 5.6 instance at Amazon AWS with R version 2.14.1 (2011-12-22). It happens on several packages: RMySQL, RODBC, FastICA. Many other packages install just fine. Your subject line cannot be really true: R CMD check calls R CMD

Re: [R] data frame manipulation with condition

2012-02-24 Thread William Dunlap
When a factor is used as a subscript it is treated as its integer codes so explicit conversion to character is needed if you want to subscript by names: f - factor(c(One,Three,Two), levels=c(One,Two,Three)) x - c(Two=2, One=1, Three=3) x[f] Two Three One 2 3 1

[R] Solved: RE: help filtering points from a scatterplot

2012-02-24 Thread Vining, Kelly
Thanks again for your help. I did indeed solve the problem by plotting the initial graph as type='n', then adding my subset of points using 'points'. Cheers, --Kelly V. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dallas Sent:

[R] package relsurv

2012-02-24 Thread Annalisa Orenti
Dear R-Users, I've recently used relsurv package for relative survival analysis. In particular I've tried to reproduce the examples proposed in the R-documentation about rsadd, rsmul and rstrans functions in R latest version (R 2.14.1). These examples don't run and the error message is always

[R] Speeding up accumulation code in large matrix calc?

2012-02-24 Thread robertfeldt
Hi, I have R code like so: num.columns.back.since.last.occurence - function(m, outcome) { nrows - dim(m)[1]; ncols - dim(m)[2]; res - matrix(rep.int(0, nrows*ncols), nrow=nrows); for(row in 1:nrows) { for(col in 2:ncols) {

[R] NaN's in class 'performance; [package ROCR]

2012-02-24 Thread Chet Seligman
The first item in @ y.values is a NaN Slot y.values: [[1]] [1] NaN 1.000 How do replace it with 1.00 or otherwise get rid of it? Chet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] saving all data in r object

2012-02-24 Thread uday
Hi Iris, thanks for reply but this solution does not work Uday -- View this message in context: http://r.789695.n4.nabble.com/saving-all-data-in-r-object-tp4413092p4417933.html Sent from the R help mailing list archive at Nabble.com. __

[R] Producing KML files

2012-02-24 Thread Desflots, Melicie
Hi, I am very new to R and I am trying to write KML files. I am running R-2.13.1 and I have the following packages: - AKIMA - RGDAL - RSAGA - SP I was trying to run the simple example that I found at the following web page:

[R] UT Summer Statistics Institute--info for R-help

2012-02-24 Thread SSC Postdoc Search
Dear R-help, The Division of Statistics + Scientific Computation at The University of Texas at Austin will be hosting the University¹s fifth annual UT Summer Statistics Institute on the UT Austin campus from May 21 ­ May 24, 2012. Short courses are offered at all levels including introductory

[R] listing array after loop

2012-02-24 Thread uday
I want to create r object from my data set. I have several data files and I would like to read individual parameter from file and save all 10 files parameter in a single array e.g setwd(/temp/) file_s - list.files(path = ., pattern = 0b.was, all.files = FALSE, full.names =

[R] strange behaviour of POSIXlt POSIXt object

2012-02-24 Thread ikuzar
Hi, Does anybody know why get I this kind of strange situation: Browse[2] hcEnd [1] 2009-03-29 06:30:00 Browse[2] class(hcEnd) [1] POSIXlt POSIXt Browse[2] is.na(hcEnd) [1] TRUE This issue is the source of my all issues in my program, Thanks for your help -- View this message in context:

Re: [R] help filtering points from a scatterplot

2012-02-24 Thread Dallas
Okay. I think I understand now. You would just like nothing to be plotted for the points below a certain threshold but there will still be that space indexing where the point would've gone. I hope I have this right. So what you could do to fix that is to make a new matrix (still including all

[R] permutation approach to know effect of one factor (factor A) to another (factor B) in each level of factor A (although it is slow)

2012-02-24 Thread Kazunari Nozue
Hi all, At first I will explain my linear mixed effects model; lme1 - lme(leaf_length ~ Treatment*Genotype*leaf,random=~Treatment|Set,data=data) or lmer1 - lmer(leaf~Treatment*Genotype*leaf+(Treatment|Set),data=data) Treatment factor has two conditions: mock (=Mo) and treatment(=Tr) Leaf is

Re: [R] strange behaviour of POSIXlt POSIXt object

2012-02-24 Thread R. Michael Weylandt michael.weyla...@gmail.com
Can you dput(hcEnd) and give a snippet of the code that generates it? Michael On Feb 24, 2012, at 12:57 PM, ikuzar raz...@hotmail.fr wrote: Hi, Does anybody know why get I this kind of strange situation: Browse[2] hcEnd [1] 2009-03-29 06:30:00 Browse[2] class(hcEnd) [1] POSIXlt POSIXt

Re: [R] strange behaviour of POSIXlt POSIXt object

2012-02-24 Thread Curt Seeliger
Does anybody know why get I this kind of strange situation: Browse[2] hcEnd [1] 2009-03-29 06:30:00 Browse[2] class(hcEnd) [1] POSIXlt POSIXt Browse[2] is.na(hcEnd) [1] TRUE pp-as.POSIXlt(2009-03-29 06:30:00) pp [1] 2009-03-29 06:30:00 class(pp) [1] POSIXlt POSIXt is.na(pp) [1] FALSE

Re: [R] strange behaviour of POSIXlt POSIXt object

2012-02-24 Thread jim holtman
What version of R are you using. Here is the results with 2.14.1 under Windows: x - as.POSIXlt(2009-03-29 06:30:00) x [1] 2009-03-29 06:30:00 class(x) [1] POSIXlt POSIXt is.na(x) [1] FALSE On Fri, Feb 24, 2012 at 12:57 PM, ikuzar raz...@hotmail.fr wrote: Hi, Does anybody know why get

[R] install rJava in Ubuntu 11.10

2012-02-24 Thread John Kane
I am trying to install rJava on a WUBI Ubuntu 11.10 installation of R with no luck. I was originally trying to install the iplots package and encountered this rJava problem. Code used: install.packages(rJava) (CRAN mirrors --Canada(ON) and Canada(QC2) I installed iplots with no problem on

Re: [R] tcl tk command function with arguments ??

2012-02-24 Thread ilai
On Fri, Feb 24, 2012 at 12:58 AM, Alexander juschitz_alexan...@yahoo.de wrote: I would like to know if its possible to use a function with arguments as a command in tcl tk. Yes snip I think this is due to the fact that the PressedOK(3) was the last call of the function, but I don't

Re: [R] Speeding up accumulation code in large matrix calc?

2012-02-24 Thread Petr Savicky
On Fri, Feb 24, 2012 at 08:59:44AM -0800, robertfeldt wrote: Hi, I have R code like so: num.columns.back.since.last.occurence - function(m, outcome) { nrows - dim(m)[1]; ncols - dim(m)[2]; res - matrix(rep.int(0, nrows*ncols), nrow=nrows); for(row in 1:nrows) {

Re: [R] R CMD INSTALL fails where R CMD check succeeds.

2012-02-24 Thread Rob Steele
That's it! I was mounting /tmp with the noexec option. That was the problem. Thanks! On 2/24/2012 12:56 PM, Prof Brian Ripley wrote: Guess: did you set TMPDIR to somewhere you are allowed to execute scripts? __ R-help@r-project.org mailing list

[R] shell command with Robocopy error

2012-02-24 Thread Aldo
Ok so my problem is I am running a shell command to copy certain file types from one directory to another and it returns multiple errors the code is models=c(1sFE1cFE,1sFE1cFEp) for(m in 1:length(models)){ shell(paste(robocopy C:\\Sim_Test_1\\Sim,models[m], ,

Re: [R] install rJava in Ubuntu 11.10

2012-02-24 Thread Arnaud Gaboury
As a Linux user, I know you are not running exactly the same Java as on windows. It exists some copyright issues which prevent you to run Sun Java on your Linux box. As shown, you are running in fact openJDK. If result is the same for you, being able to run Java, it is not the same for most

Re: [R] package relsurv

2012-02-24 Thread Prof Brian Ripley
On 24/02/2012 16:30, Annalisa Orenti wrote: Dear R-Users, I've recently used relsurv package for relative survival analysis. In particular I've tried to reproduce the examples proposed in the R-documentation about rsadd, rsmul and rstrans functions in R latest version (R 2.14.1). These

Re: [R] Speeding up accumulation code in large matrix calc?

2012-02-24 Thread Petr Savicky
On Fri, Feb 24, 2012 at 08:59:44AM -0800, robertfeldt wrote: Hi, I have R code like so: num.columns.back.since.last.occurence - function(m, outcome) { nrows - dim(m)[1]; ncols - dim(m)[2]; res - matrix(rep.int(0, nrows*ncols), nrow=nrows); for(row in 1:nrows) {

Re: [R] multhist weird behavior/ xlabels wrong

2012-02-24 Thread Laura Matrajt
Hi Jim, thanks for your reply, I will try using this instead! best, Laura On Feb 24, 2012, at 3:09 AM, Jim Lemon wrote: On 02/24/2012 09:30 AM, Laura Matrajt wrote: Hi, I found some weird behavior of the function multhist in the plotrix package and I would like to ask you about it:

Re: [R] data frame manipulation with conditions

2012-02-24 Thread ilai
On Fri, Feb 24, 2012 at 8:11 AM, A2CT2 Trading trad...@a2ct2.com wrote: Dear list, n00b question, but still can't find any easy answer. Here is a df: df-data.frame(cbind(x=c(AA,BB,CC,AA),y=1:4)) # No, your y is a factor str(df) 'data.frame': 4 obs. of 2 variables: $ x: Factor w/ 3

Re: [R] listing array after loop

2012-02-24 Thread Petr Savicky
On Fri, Feb 24, 2012 at 09:48:16AM -0800, uday wrote: I want to create r object from my data set. I have several data files and I would like to read individual parameter from file and save all 10 files parameter in a single array e.g setwd(/temp/) file_s - list.files(path = ., pattern =

Re: [R] data frame manipulation with conditions

2012-02-24 Thread Arnaud Gaboury
TY Elai for your answer. One solution has been given earlier in this list by Sarah Goslee and William Dunlap. Arnaud Gaboury   A2CT2 Ltd. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ilai Sent: vendredi 24 février 2012 20:14

Re: [R] data frame manipulation with conditions

2012-02-24 Thread ilai
Ahh, I see it now. For some reason your original post popped up on the list again, could be just my mail server, sorry. Looks like Uwe gave you the same solution (in two lines for better clarity) right away. Depending on your level of noobiness, my advice would have been to ignore everything after

Re: [R] Speeding up accumulation code in large matrix calc?

2012-02-24 Thread Berend Hasselman
On 24-02-2012, at 20:02, Petr Savicky wrote: On Fri, Feb 24, 2012 at 08:59:44AM -0800, robertfeldt wrote: Hi, I have R code like so: num.columns.back.since.last.occurence - function(m, outcome) { nrows - dim(m)[1]; ncols - dim(m)[2]; res - matrix(rep.int(0,

[R] Optim() package restriction

2012-02-24 Thread nserdar
Hi I need a phi restriction in my code. That is 0phi1 How can I do that ? Linn=function(param){ phi=param[1] sigw=param[2] sigv=param[3] Betam=param[4] kf=kfilter1(n,st[,k],st[,1],0,1,phi,Betam,sigw,sigv) return(kf$like) } init.par-c(1,1,1,1) estimate-

Re: [R] shell command with Robocopy error

2012-02-24 Thread Aldo
Also it copies the files, but I am using this as part of a larger code block and concerned the errors will kill the loop -- View this message in context: http://r.789695.n4.nabble.com/shell-command-with-Robocopy-error-tp4418254p4418345.html Sent from the R help mailing list archive at

[R] find difference between data frames

2012-02-24 Thread psy106616
I have one data frame, like below: kindxy 11 8 9 21443 31257 41 36 20 52 2 14 62 36 20 so, I want to find unique coordinates in

[R] B-spline/smooth.basis derivative matrices

2012-02-24 Thread Vassily Shvets
Hello, I've noticed that SPLUS seems to have a function for evaluating derivative matrices of splines. I've found the R function that evaluates matrices from 'smooth.spline'; maybe someone has written something to do the same with smooth.basis? regards, s

[R] RBFNetwork in RWeka

2012-02-24 Thread EKN
Dear Forum, I have installed and used various Weka functions in R - both already available interfaces or created ones via make_Weka_classifier - without any trouble. However, the RBFNetwork (RBF Neural Network) function is one that I have not been able to call. I tried creating the R interface

[R] evaluating derivative matrices of spline functions

2012-02-24 Thread Vassily Shvets
Hello, I've noticed that SPLUS has a function for evaluating the derivative matrices of splines. I've also noticed that there's a function in R for evaluating matrices from smooth.spline; maybe someone knows if something has been written to evaluate matrices from 'smooth.basis'? regards, s

Re: [R] Speeding up accumulation code in large matrix calc?

2012-02-24 Thread Petr Savicky
On Fri, Feb 24, 2012 at 09:06:28PM +0100, Berend Hasselman wrote: [...] I've done some speed tests. t1 - function(m, outcome) { nrows - dim(m)[1] ncols - dim(m)[2] res - matrix(rep.int(0, nrows*ncols), nrow=nrows) for(row in 1:nrows) { for(col in

Re: [R] evaluating derivative matrices of spline functions

2012-02-24 Thread Spencer Graves
I don't know about smooth.spline, but the fda package includes deriv.fd. It also includes eval.fd and predict.fd. If you only want a first derivative, then differentiating a standard cubic spline may be adequate. However, the first derivative of a cubic spline is a quadratic spline,

Re: [R] Optim() package restriction

2012-02-24 Thread ilai
On Fri, Feb 24, 2012 at 12:18 PM, nserdar snes1...@hotmail.com wrote: Hi I need a phi restriction in my code. That is   0phi1 How can I do that ? init.par-c(1,1,1,1) estimate- optim(init.par,Linn,gr=NULL,method= BFGS, hessian=FALSE,control = list(trace=1)) You want method L-BFGS-B not

Re: [R] Speeding up accumulation code in large matrix calc?

2012-02-24 Thread Petr Savicky
On Fri, Feb 24, 2012 at 09:06:28PM +0100, Berend Hasselman wrote: [...] Summary of results Nrow - 100 Ncol - 1000 A - matrix((runif(Ncol*Nrow)0.2)+0, nrow=Nrow) print(rbind(z1,z2,z3,z4,z5,z6)) user.self sys.self elapsed user.child sys.child z1 0.5430.005 0.551 0

Re: [R] testing two data sets

2012-02-24 Thread Greg Snow
?ks.test ?qqplot also look at permutation tests and possibly the vis.test function in the TeachingDemos package. Note that with all of these large samples may give you power to detect meaningless differences and small samples may not have enough power to detect potentially important differences.

[R] looping over string of frames when importing with 'sqlFetch' from a Microsoft Access database

2012-02-24 Thread Eric Fail
Dear R-list, I am trying to import (all) frames from a Microsoft Access database as individual data frames in a fancy loop, but I'm having troubles figuring out how to use the 'sqlFetch' from the RODBS package in a loop (mostly because I can't figure out how to loop over elements (I came from

[R] syntaxe problem

2012-02-24 Thread Adel ESSAFI
Hello, I want to create 10 dataframe using a for loop. I don t know what to do to create 10 different dataframes whose name is parametrized with variable i. This syntaxe fails. It create a unique fataframe called dfn. Any input will help Thanks for (i in 1:10){ + filename=paste(avail4,i,sep =

  1   2   >