Re: [R] Randomized Points in space/ saving model results

2011-10-30 Thread magono
Thank you both for your help. If I have any further questions after I give this a go I'll get back to you. This was much appreciated. M. -- View this message in context: http://r.789695.n4.nabble.com/Randomized-Points-in-space-saving-model-results-tp3922612p3954834.html Sent from the R help ma

Re: [R] Randomized Points in space/ saving model results

2011-10-30 Thread magono
Ok, to michael Looking over what you posted I'm thinking this is the way forward but my lack of experience using functions is getting in the way of accomplishing the task. Examining the outputs into the functions and putting in my own info is giving me a headache. Here's my thoughts at each step

[R] tryCatch with integration

2011-10-30 Thread statfan
I am trying to compute the approximate numerical integration of the following expression using the integrate function: > (integrate(function(x) {log(1+x^2)*(1+x^2)^(-20.04543)},low,Inf)$val) Error in integrate(function(x) { : the integral is probably divergent which gives me an error. If

[R] Error in dim(data) <- dim : attempt to set an attribute on NULL.

2011-10-30 Thread arunkumar1111
This post has NOT been accepted by the mailing list yet. Hi, I'm passing the input parameters and calculating the linear regression. some time i'm getting the error Error in dim(data) <- dim : attempt to set an attribute on NULL. But when i restart my R studio, then it runs. Please help to res

[R] How to use IML with R and SAS

2011-10-30 Thread Cheryl Johnson
Hello, I have a for loop that generates data in R. With the IML program, I would like to analyze data in SAS from each iteration of the for loop in R. It would be helpful if someone could explain to me how to analyze data this way. Thanks [[alternative HTML version deleted]] ___

Re: [R] Get missinfg values with dataframe using read.spss

2011-10-30 Thread Joshua Wiley
Hi Smart Guy, You can try use.missings = TRUE. I am not sure how well this will work. If you really need it and use.missings = TRUE does not work, I would just read it in as a list, and then maybe create a new data frame based on the list. See ?as.data.frame for a way to do this. Then you could

[R] Get missinfg values with dataframe using read.spss

2011-10-30 Thread Smart Guy
Hi All, Here is my problem. I need to get data frame (and not a list) while reading spss file using read.spss. For which I can put one parameter of read.spss as to.data.frame=TRUE. Now in doing so, I dont get missing values. Is there a way to get missings values along with data frame? T

Re: [R] new R debugging tool

2011-10-30 Thread Norm Matloff
Rainer wrote: * On Thu, Oct 20, 2011 at 12:22 AM, Norm Matloff * wrote: * * > * > I've developed a new R debugging tool, debugR, available at * > http://heather.cs.ucdavis.edu/debugR.html * > * > This basically replaces my edtdbg, which I will no longer be * > supporting. * > The new to

Re: [R] finding row duplicates, regardless of element order

2011-10-30 Thread jim holtman
try this: > M <- matrix(c("1","2","3","2","4","5","5","3","2","1","3","2","4","4"), > ncol=2) > M [,1] [,2] [1,] "1" "3" [2,] "2" "2" [3,] "3" "1" [4,] "2" "3" [5,] "4" "2" [6,] "5" "4" [7,] "5" "4" > # not the most efficient > M.sorted <- apply(M, 1, function(x) paste(sort(x), co

[R] finding row duplicates, regardless of element order

2011-10-30 Thread Wet Bell Diver
Dear list, Suppose I have the following matrix: > M <- matrix(c("1","2","3","2","4","5","5","3","2","1","3","2","4","4"), ncol=2) > M [,1] [,2] [1,] "1" "3" [2,] "2" "2" [3,] "3" "1" [4,] "2" "3" [5,] "4" "2" [6,] "5" "4" [7,] "5" "4" In this matrix, row 1 contains elements "1" an

[R] curiosity only: gpu ?

2011-10-30 Thread ivo welch
dear R experts. about once a year, I wonder where GPU computing is. this is of course a quickly moving field, so I am hoping to elicit some advice from those that have followed the developments more actively. fortunately, unlike my many other cries for help, this post is not critical. it is mor

Re: [R] Generic Plot and save function

2011-10-30 Thread Joshua Wiley
Hi, Regarding, ..., you literally just pass For example: f <- function(d, ...) { lapply(d, mean, ...) } f(1:10) # but you could pass other arguments to lapply. Regarding saving, my thought would be to just switch which device is started based on path. I'm sure thre are other, possibly

Re: [R] help to extract data with R

2011-10-30 Thread Weidong Gu
One option is to use table to get the number of repeats tab<-table(tr1$time)==3 time3<-names(tab)[tab] tr1[tr1$time%in%time3,] Weidong Gu On Sun, Oct 30, 2011 at 5:10 PM, Zheng Lu wrote: > > > > > With the following dataset, trl =1, 2,3, how to extract data with the time > repeated 3 times. Fo

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread Alaios
Good point indeed, actually I want to have numericVector==0 (get that points). What is the difference between though !numericVector==0 and -numericVector==0 when used inside a matrix to pinpoint matrix entries? B.R Alex From: William Dunlap Cc: "R-hel

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread David Winsemius
Duncan Murdoch-2 wrote: > > On 11-10-30 2:52 PM, Alaios wrote: >> Dear all, >> >> Could you please explain me why >> >>> OverloadsTesT >> [1] 1 0 1 0 0 0 0 0 0 0 >>> a<-matrix(data=seq(1,10),nrow=10) >>> a >> [,1] >> [1,]1 >> [2,]2 >> [3,]3 >> [4,]4 >> [5,]5 >> [6,]6 >> [7

Re: [R] jarquebera_test_results

2011-10-30 Thread David Winsemius
Szűcs Ákos wrote: > > Hi! > I got a loop where i print out the results of Jarque Bera tests, but I > have to put, the p-values in a vector. Can you help me how to do it in > an effective way and not just typing in the results to a vector? Thanks > a lot, here is the code: > for(i in 1:60){ > p

[R] help to extract data with R

2011-10-30 Thread Zheng Lu
With the following dataset, trl =1, 2,3, how to extract data with the time repeated 3 times. For example, I am only interested in the data records with time repeated 3 times. time=0.1 only has 1 time, we don't want it, time=0.3 only has two times, we don't want it, and so on. Thanks a lot.

Re: [R] Parametric tests

2011-10-30 Thread David Winsemius
Cem Girit-2 wrote: > > Hello, > > I am interested in parametric multi comparison tests such > as > Dunnett, Duncan, Tukey, Newman-Keuls, Bonferonni, Scheffe, and > non-parametric tests such as Kruskal-Wallis, and Mann-Whitney U. Are > there > packages that include most of these

Re: [R] Generic Plot and save function

2011-10-30 Thread Alaios
I am replying to myself as regardless of the save I described below I also want to do something like the following do_analysis_for_data_sets <- function(AnalysisFunction, DataSets, ...) {     lapply(DataSets,AnalysisFunction, "how to pass the ... to lapply") } which means that I want to p

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread andrija djurovic
You are absolutely right it is better. This was just an example how one can convert the positives to TRUE and zeros to FALSE as it was asked. Andrija On Sun, Oct 30, 2011 at 9:57 PM, William Dunlap wrote: > I like to use numericVector != 0 instead of > is.logical(numericVector) because the for

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread William Dunlap
I like to use numericVector != 0 instead of is.logical(numericVector) because the former more directly indicates what you want to happen instead of relying on knowledge that numeric 0 maps to logical FALSE. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > Fro

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread William Dunlap
myvec != 0 does the same as ifelse(myvec == 0, FALSE, TRUE) but more quickly Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Sarah Goslee > Sent: Sunday, October 30,

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread Alaios
I think this does the work return(m[!as.logical(data)]) I am not sure though if this is the same with return(m[!as.logical(data)]) From: andrija djurovic Cc: "R-help@r-project.org" Sent: Sunday, October 30, 2011 9:58 PM Subject: Re: [R] why the a[-indx] do

Re: [R] Normality tests on groups of rows in a data frame, grouped based on content in other columns

2011-10-30 Thread Dennis Murphy
Hi: Here are a few ways (untested, so caveat emptor): # plyr package library('plyr') ddply(df, .(Plant, Tissue, Gene), summarise, ntest = shapiro.test(ExpressionLevel)) # data.table package library('data.table') dt <- data.table(df, key = 'Plant, Tissue, Gene') dt[, list(ntest = shapiro.test(Exp

Re: [R] Problem with svyvar in survey package

2011-10-30 Thread Thomas Lumley
Well, you need to use the current version, then. -thomas On Fri, Oct 28, 2011 at 10:09 PM, amitava wrote: > I am using Package survey version 3.20 and R 2.11.1. > > --Amitava > > -- > View this message in context: > http://r.789695.n4.nabble.com/Problem-with-svyvar-in-survey-package-tp39328

Re: [R] jarquebera_test_results

2011-10-30 Thread Dennis Murphy
Hi: I'd double check the form of the upper bound of the sequence. In the first case (i = 1), it uses the subvector loghozamok[1:220]; when i = 2, it uses the subvector loghozamok[21:260], etc. In the last case, it uses loghozamok[1181:1420]. If instead you want to split the vector into 60 groups o

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread andrija djurovic
> as.logical(c(1,0,1,1)) [1] TRUE FALSE TRUE TRUE ?as.logical On Sun, Oct 30, 2011 at 8:50 PM, Alaios wrote: > probably you mean > > > > > For ‘[’-indexing only: ‘i’, ‘j’, ‘...’ can be logical > vectors, indicating elements/slices to select. Such vectors > are recycled if necessary to mat

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread Sarah Goslee
ifelse(myvec == 0, FALSE, TRUE) # set 0 to FALSE, other values to TRUE On Sun, Oct 30, 2011 at 3:50 PM, Alaios wrote: > probably you mean > > > > > For ‘[’-indexing only: ‘i’, ‘j’, ‘...’ can be logical > vectors, indicating elements/slices to select.  Such vectors > are recycled if necessary to

Re: [R] Graphics Reciprocal labeling

2011-10-30 Thread Hurr
I suppose I wasn't clear enough. For some purposes, I want to label the horizontal axis like the first label-line below. It separates the longer periods better even though it squashes the shorter ones. The real scale for the corresponding plotted data is the second label-line. The same-range linear

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread Alaios
probably you mean For ‘[’-indexing only: ‘i’, ‘j’, ‘...’ can be logical vectors, indicating elements/slices to select. Such vectors are recycled if necessary to match the corresponding extent. ‘i’, ‘j’, ‘...’ can also be negative integers, indicating elements/slices

[R] Confidence interval for Support Vector Regression

2011-10-30 Thread Muhammed Akbulut
Hi, Is it possible to calculate confidence intervals for support vector regression? In the "ksvm{kernlab}" manual, it says that it supports confidence intervals for regression. However, i couldn't find any information about how to calculate confidence interval. Do you have any documents or example

[R] Normality tests on groups of rows in a data frame, grouped based on content in other columns

2011-10-30 Thread Joel Fürstenberg-Hägg
Dear R users, I have a data frame in the form below, on which I would like to make normality tests on the values in the ExpressionLevel column. > head(df) ID Plant Tissue Gene ExpressionLevel 1 1 p1 t1 g1 366.53 2 2 p1 t1 g2 0.57 3 3 p1 t1 g311.81 4 4

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread William Dunlap
> a[overLoadTesT==0] [1] 2 4 5 6 7 8 9 10 Look into help('[') or help('Subscript') to see how integer and logical (Boolean) subscripts differ. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun..

[R] Generic Plot and save function

2011-10-30 Thread Alaios
Dear all, I was reading for the nice ... parameter option in R, which if I got it right it is used to pass other parameter to some other function inside your function for example plot_duty_cycle<- function(data, ...) {        barplot(duty_cycle_per_bin(data), ...) } I can put some param

Re: [R] why the a[-indx] does not work?

2011-10-30 Thread Duncan Murdoch
On 11-10-30 2:52 PM, Alaios wrote: Dear all, Could you please explain me why OverloadsTesT [1] 1 0 1 0 0 0 0 0 0 0 a<-matrix(data=seq(1,10),nrow=10) a [,1] [1,]1 [2,]2 [3,]3 [4,]4 [5,]5 [6,]6 [7,]7 [8,]8 [9,]9 [10,] 10 a[-OverloadsTesT] [1] 2 3 4

Re: [R] Summary stats in table

2011-10-30 Thread Duncan Murdoch
On 11-10-24 7:16 PM, Hadley Wickham wrote: On Mon, Oct 24, 2011 at 5:39 AM, Duncan Murdoch wrote: Suppose I have data like this: A<- sample(letters[1:3], 1000, replace=TRUE) B<- sample(LETTERS[1:2], 1000, replace=TRUE) x<- rnorm(1000) I can get a table of means via tapply(x, list(A, B), mea

[R] why the a[-indx] does not work?

2011-10-30 Thread Alaios
Dear all, Could you please explain me why > OverloadsTesT [1] 1 0 1 0 0 0 0 0 0 0 > a<-matrix(data=seq(1,10),nrow=10) > a [,1] [1,]1 [2,]2 [3,]3 [4,]4 [5,]5 [6,]6 [7,]7 [8,]8 [9,]9 [10,] 10 > a[-OverloadsTesT] [1] 2 3 4 5 6 7 8 9 10 the last line d

[R] jarquebera_test_results

2011-10-30 Thread Szűcs Ákos
Hi! I got a loop where i print out the results of Jarque Bera tests, but I have to put, the p-values in a vector. Can you help me how to do it in an effective way and not just typing in the results to a vector? Thanks a lot, here is the code: for(i in 1:60){ print(jarque.bera.test(loghozamok[(

Re: [R] Maximization

2011-10-30 Thread Paul Smith
On Tue, Oct 25, 2011 at 12:04 PM, Eliano wrote: > hi people, > > I'm trying to maximize this function: > > fn= function (x) {x[1]^2+5*x[2]^2} > > with this restriction > fn1 = function (x) {x[1]+x[2] <=5} > > Can someone help me how to procedure this? > > I tried in the alabama and genoud package

[R] Rpart

2011-10-30 Thread Luisa Sêco
Dear users, I'm using rpart for classification trees, but my code isn't working when I try to use all the variables in my data frame. This data frame was created from a data frame with 1775 variables, but I choose only 13. arv13<-rpart(iv~.,data=gn,method="class",parms=list(split="information"))

[R] calculating joint entropy of many variables

2011-10-30 Thread Reza Salimi-Khorshidi
Hello list. I need help (e.g., a reference, code, package, etc.) in calculating the joint entropy of many variables (some sure highly mutually-informative and some not). Is there anyone here who knows a computationally-efficient solution (such as an R package)? I appreciate you help ... Best, Reza

Re: [R] element-by-element comparison

2011-10-30 Thread Uwe Ligges
On 30.10.2011 04:51, Wendy wrote: Hi, I have a vector and a matrix. For example, A = [ 12 3 4]; B = [ 4 13 10 2 4 8]; I am comparing A to each column of B using A>B[,ii], so the expected result is C = [ 10 01 00]; This list is about R rather than Matlab dial

Re: [R] element-by-element comparison

2011-10-30 Thread Enrico Schumann
The recycling rule should apply here (see 'An Introduction to R', Sec. 5.4.1; and ?Comparison, under 'Value'). x <- -5:5 A <- cbind(x, x, x) vec <- numeric(length(x)) A > vec ### recycling apply(A,2,`>`,vec) ### using apply vec <- numeric(11) + 3; vec[1] <- -6 A > vec

Re: [R] element-by-element comparison

2011-10-30 Thread Tsjerk Wassenaar
Hi, To compare row wise is merely to compare column wise using the transpose matrix: t(B) < A or t(t(B) wrote: > Given that you want to compare > columns, you can just do: > > A > B > > If you wanted to compare rows, then > it is more troublesome.  One approach > would be: > > rep(A, each=nrow(

Re: [R] element-by-element comparison

2011-10-30 Thread Patrick Burns
Given that you want to compare columns, you can just do: A > B If you wanted to compare rows, then it is more troublesome. One approach would be: rep(A, each=nrow(B)) > B On 30/10/2011 03:51, Wendy wrote: Hi, I have a vector and a matrix. For example, A = [ 12 3 4]; B = [ 4 13 10

Re: [R] element-by-element comparison

2011-10-30 Thread Tsjerk Wassenaar
Hi Wendy, Most of the binary operators can deal with matrices and vectors natively: A<-c(12,3,4) B<-matrix(c(4,10,4,13,2,8),3,2) B [,1] [,2] [1,]4 13 [2,] 102 [3,]48 B wrote: > On 10/30/2011 02:51 PM, Wendy wrote: >> >> Hi, >> >> I have a vector and a matrix. For exampl

Re: [R] element-by-element comparison

2011-10-30 Thread Jim Lemon
On 10/30/2011 02:51 PM, Wendy wrote: Hi, I have a vector and a matrix. For example, A = [ 12 3 4]; B = [ 4 13 10 2 4 8]; I am comparing A to each column of B using A>B[,ii], so the expected result is C = [ 10 01 00]; I am looking for a way to do this quickly ins

Re: [R] Redundancy canonical analysis plot problem in 3D using VEGAN, RGL, SCATTERPLOT3D and SFSMISC

2011-10-30 Thread Jari Oksanen
uqtr.ca> writes: > > Hi Guys, > > First, English is not my native language so sorry if the question is > too difficult to understand. I can rephrase it if necessary. > > I noticed the following  code to explain as clearly as possible the > problems encountered. > > I am not able to add

Re: [R] reasonable theory?

2011-10-30 Thread James Cloos
> "SG" == Spencer Graves writes: SG> If you know nothing about the black box except that its domain is SG> bounded, then I would random sample uniformly from the domain. If the SG> function is monotonically increasing in all variables, then you only SG> need to test the two extreme points.

[R] element-by-element comparison

2011-10-30 Thread Wendy
Hi, I have a vector and a matrix. For example, A = [ 12 3 4]; B = [ 4 13 10 2 4 8]; I am comparing A to each column of B using A>B[,ii], so the expected result is C = [ 10 01 00]; I am looking for a way to do this quickly instead of going through the for loop