Re: [R] List to Array: How to establish the dimension of the array

2012-01-24 Thread Ajay Askoolum
Thanks you, I can get the length of aa with length(unlist(aa)). If aa has 4 dimensions, I imagine I'd need to do max(sapply(aa,sapply,sapply,length) How can I do this in a generic way? That is in a loop. I am clear about the exit condition for the loop. d<-1 start loop if d = length(unl

[R] adehabitatLT -- movement based kernel density

2012-01-24 Thread Juliane Struve
Dear list,   I am intersted in estimating movement based kernel densities for fish that were relocated at fixed receivers positioned along the coast. These data tend to display both a drift movment between receivers and a random movement component that can be estimated from the mean and the vari

[R] Wavelet matrix

2012-01-24 Thread Sachinthaka Abeywardana
Hi all, I am needing to create a wavelet Basis matrix such that f=Bw where f is the signal, B the basis matrix and, w the weight matrix. I am not concerned about w which I can easily obtain from most wavelet packages. Is there a package/ function that can create the B matrix (supposing it is a Haa

[R] Matrix and boucle.

2012-01-24 Thread Glen360
Hello, I made a boucle that put data inside N matrix. So for N=45, I have M1:M45. Then I want to make a sn.em on each columns of each matrix. I don't know how to call a i matrix (matrix(i) / matrix[i]) for i in 1:45. Here is the code to make M1:M45 numberOfConfig8min <- length(numberOfCloseNonM

Re: [R] POSIXct value display incorrect for some values

2012-01-24 Thread David Winsemius
On Jan 24, 2012, at 4:25 PM, Curt Seeliger wrote: Yes, you're right about this being a floating point issue. I guess I wasn't clear enough that this was already understood. I'd have responded earlier the response somehow missed my mailbox. My question is rather whether there is a work aro

Re: [R] Null models of species co-occurrence

2012-01-24 Thread Dallas
Thank you very much. I'll look into the r project listserv you suggested. Unrelated: Ecological Models and Data in R is one of my favorite mathematical ecology textbooks and a fantastic resource. On Tue, Jan 24, 2012 at 9:30 PM, bbolker [via R] < ml-node+s789695n4326186...@n4.nabble.com> wrote:

Re: [R] Null models of species co-occurrence

2012-01-24 Thread Ben Bolker
Dallas drakeresearchlab.com> writes: > I am currently testing species co-occurrence patterns using null models and > the oecosimu() function within the vegan() package. My issue is that none of > the methods appear to be the ones that I want. The methods listed are r0, > r1, r2, r2dtable, swap, t

Re: [R] gsub semicolon with double quotation mark

2012-01-24 Thread Ista Zahn
Hi Assa, I think you should back up and tell us what you're trying to accomplish. You can replace characters in the column just as you do in a vector. But I think that is not what you're trying to do. Are you trying to split the column into three different columns? If so you can look at the colspl

Re: [R] Writing a function to return column position XXXX

2012-01-24 Thread R. Michael Weylandt
I think you are getting stuck on the same regexp problem as before (i.e., once again the dollar sign is being interpreted as the beginning of the line rather than an actual dollar sign) If I understand your question, might I suggest something much easier? x = data.frame(a = c("$1034.23","1,230"),

Re: [R] Moving-Tiles Bootstrap

2012-01-24 Thread R. Michael Weylandt
So I'll preface this with the admission I have no idea what moving-tiles or boot.tilt are and so I may be in way over my head, but if you are having trouble fitting your bootstrap procedure into one of those provided in package, it's not hard to roll your own with replicate() in base R. The key is

Re: [R] Virus Infection in colorspace_1.1-1.zip (R x64 2.14.1)

2012-01-24 Thread Duncan Murdoch
On 12-01-24 2:46 PM, Stephen P Molnar wrote: I keep finding the Win32\Huer virus in colorspace_1.1-1.zip for R x64 2.14.1 running MS Windows 7. As a result I am not able to use rattle or ChemometricsWithR. I have tried several different mirrors with the same result. Fortunately AVG has caught

Re: [R] Converting strings into data frame column names

2012-01-24 Thread R. Michael Weylandt
Yes, I think you are overcomplicating: it's perfectly valid to subscript by names. (In fact, it's generally preferred to trying to use the $ for programming because it's so much more flexible) I.e., lapply( phList, function(df) get(df)[, c("ID", "DATE_DISPENSED", "TG_NAME1", "TG_NAME2", "TG_NAME3"

Re: [R] loops

2012-01-24 Thread R. Michael Weylandt
You can use the assign() function. E.g., assign("a", 3,) But the more R thing to do is to create a list of your results (which you can name) and to handle that whole object. Then if you want to do things to each object you create, it's as simple as lapply Michael On Tue, Jan 24, 2012 at 7:27 PM,

[R] which function/method to find agreement between two

2012-01-24 Thread Mary Kindall
Hi I have data in the following format: itemsperson1 person2 - - -- car honda,toyotahonda bikesuzuki suzuki pant Lee Levis, Lee shirt Van_housen Hollister house rented

Re: [R] Virus Infection in colorspace_1.1-1.zip (R x64 2.14.1)

2012-01-24 Thread R. Michael Weylandt
I'm skeptical that CRAN would produce a bug, but it's not unheard of for anti-viruses to not like its compiled code. Are you able to compile locally? That might make it more comfortable -- if you do so, you could also white list those files (since you made them) Not a perfect workaround, but AV te

Re: [R] Virus Infection in colorspace_1.1-1.zip (R x64 2.14.1)

2012-01-24 Thread Henrik Bengtsson
[R] False Virus detection with colorspace package? [Tue Nov 8 00:44:37 CET 2011] https://stat.ethz.ch/pipermail/r-help/2011-November/294875.html /H On Tue, Jan 24, 2012 at 11:46 AM, Stephen P Molnar wrote: > I keep finding the Win32\Huer virus in colorspace_1.1-1.zip for R x64 2.14.1 > running M

Re: [R] Select elements from text

2012-01-24 Thread R. Michael Weylandt
paste(text, collapse = " ") Michael On Tue, Jan 24, 2012 at 3:41 PM, mdvaan wrote: > Thanks for the quick response. I get the latter part, but reading the text > from MS word into R is problematic. I am able to read in (scan) all unique > elements (following sep=" ") from the text, but unable to

Re: [R] Moving-Tiles Bootstrap

2012-01-24 Thread Jeff Newmiller
I wouldn't characterize the requirement to provide R code as simply "nuts and bolts", but rather a preference for precision in communication. Very definitely there are theoretical discussions here, but for such discussions short R examples are used to make sure the concepts are understood. -

[R] loops

2012-01-24 Thread Philip Shirk
I've been struggling to get a loop to work. I want to create a new variable in each loop with data from some function. for example: # part of the names for the variables to be created Frags <- c("F04", "F05", "F07", "F09", "F11", "F13", "F14", "F17", "F18", "F19", "P20", "Main") for(obs in Frags

[R] Converting strings into data frame column names

2012-01-24 Thread dthomas
Hi all, I want to loop through a series of data frames and append them into one data frame, however I do not want all columns of the original data frames to be in the new data frame. I have the following code: phList<-c('ph2010','ph2009','ph2008','ph2007','ph2006') #Name of original data frames

[R] spaghetti plot - categorical variable differentiated by color

2012-01-24 Thread Ana PK
Hello, I am trying to create individual concentration-time spaghetti plots sorted by dose, and within each dose to show two different colors for a categorical variable (gender). I can’t find a way to add the color for gender. Groups=ID enables individual lines for each subject. If I use groups=

[R] Self organising map - label the best matching unit

2012-01-24 Thread markm0705
Dear R helpers I'm experimenting with the 'kohonen' package and have two questions. I've been following examples in the package manual and the paper from the Journal of Geostatistical software (October 2007, Volume 21, Issue 5.). I've set up a file with the 'animals' data (see attached file) wh

[R] Problem training a neural network with "neuralnet" library

2012-01-24 Thread Achuthan, Srisairam
Hi, I am having difficulty in training a neural network using the package "neuralnet". My neural network has 2 input neurons (covariates), 1 hidden layer with 2 hidden neurons and 2 output neurons (responses). I am training my neural network with a dataset that has been transformed so that ea

Re: [R] drop columns whose rows are all 0

2012-01-24 Thread Dallas
Another way would be a which statement. good_dataset=data[,which(colSums(data)!=0)] I believe this depends on how the data are structured though. -- View this message in context: http://r.789695.n4.nabble.com/drop-columns-whose-rows-are-all-0-tp4324231p4325474.html Sent from the R help maili

Re: [R] Select elements from text

2012-01-24 Thread mdvaan
Thanks for the quick response. I get the latter part, but reading the text from MS word into R is problematic. I am able to read in (scan) all unique elements (following sep=" ") from the text, but unable to past everything together again. Any id on how to solve this? It looks like this now: text

[R] Null models of species co-occurrence

2012-01-24 Thread Dallas
I am currently testing species co-occurrence patterns using null models and the oecosimu() function within the vegan() package. My issue is that none of the methods appear to be the ones that I want. The methods listed are r0, r1, r2, r2dtable, swap, tswap. However, I want to know how to go about i

[R] Virus Infection in colorspace_1.1-1.zip (R x64 2.14.1)

2012-01-24 Thread Stephen P Molnar
I keep finding the Win32\Huer virus in colorspace_1.1-1.zip for R x64 2.14.1 running MS Windows 7. As a result I am not able to use rattle or ChemometricsWithR. I have tried several different mirrors with the same result. Fortunately AVG has caught and quarantined the problem, but the colorspace

[R] Plotting coxph survival curves

2012-01-24 Thread elegant-sheep
Hi, I am attempting to plot survival curves estimated by cox proportional hazards regression model. The formula for the model is this: F.cox.weight <- coxph(Surv(Lifespan, Status) ~ MS + Weight + Laid + MS:Laid + Weight:Laid, data = LongF) MS = Mating status (mated/virgin) Weight = adult female

[R] Sampling with Constraints for testing and training data

2012-01-24 Thread Eliano
Hi People, Thus anyone have a good solution for this problem: a database called DB. index <- sample(1:nrow(DB), size=0.2*nrow(BD)) test <- DB[index,] train <- DB[-index,] One of the variables in this database contais a target variable with two values 0 and 1. Imagine now that i want to constr

Re: [R] detecting noise in data?

2012-01-24 Thread David Stevens
Michael One way to get an idea about 'groupiness' is a method described by Box and Ramirez (1992) "Cumulative Score Charts", Qual. Rel. Eng. Int., 8, 17-27 and in a book by Box and Luceno (1997) Statistical Control by Monitoring and Feedback Adjustment, Wiley Interscience, New York. This type

Re: [R] List to Array: How to establish the dimension of the array

2012-01-24 Thread Brian Diggs
On 1/24/2012 2:47 PM, Ajay Askoolum wrote: Given a variable aa in the workspace, some of its attributes are: typeof(aa) [1] "list" mode(aa) [1] "list" length(aa) [1] 2 How do I retrieve the maximum indices, in this case 2,3,4? The variable itself is: aa [[1]] [[1]][[1]] [[1]][[1]][[1]

Re: [R] Interactive map graphics.

2012-01-24 Thread Yihui Xie
Exactly. It is very complicated to get them to run under Windows. Hopefully in the future, there will be Windows versions, but I guess this will not happen in the very near future. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State Universi

Re: [R] detecting noise in data?

2012-01-24 Thread Bert Gunter
Statistical inference for group differences on groups determined from the data yields incorrect results. Groups must be prespecified. Bert On Jan 24, 2012, at 2:55 PM, "HARROLD, Tim" wrote: > You might want to provide an example? It's a pretty vague problem at the > moment. > > If the data c

Re: [R] Interactive map graphics.

2012-01-24 Thread Kevin Burton
Now I install R 2.14.1 and I get: packages 'qtbase', 'qtpaint' are not available (for R version 2.14.1) Are you saying that the windows binaries are not available for *any* version of R? From: Tengfei Yin [mailto:yinteng...@gmail.com] Sent: Tuesday, January 24, 2012 1:12 PM To: David W

Re: [R] detecting noise in data?

2012-01-24 Thread HARROLD, Tim
You might want to provide an example? It's a pretty vague problem at the moment. If the data can be easily picked out by human eyes, you might want to think about your criteria you're using to pick out a contaminated result. If you can express it in such a way that you don't need to scan each ob

Re: [R] Interactive map graphics.

2012-01-24 Thread Yihui Xie
If you are using Windows, I'm afraid you have to give up because there are no Windows binaries for these packages yet. If you are under Linux or Mac, you can follow the instructions in https://github.com/ggobi/cranvas/wiki Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Dep

[R] List to Array: How to establish the dimension of the array

2012-01-24 Thread Ajay Askoolum
Given a variable aa in the workspace, some of its attributes are: > typeof(aa) [1] "list" > mode(aa) [1] "list" > length(aa) [1] 2 How do I retrieve the maximum indices, in this case 2,3,4? The variable itself is: > aa [[1]] [[1]][[1]] [[1]][[1]][[1]] [1] 37531.52 [[1]][[1]][[2]] [1] 62787.32

Re: [R] detecting noise in data?

2012-01-24 Thread Michael
Hi all, I just wanted to add that I am looking for a solution that's in R ... to handle this... And also, in a given sample, the correct data are of the majority and the noise are of the minority. Thank you! On Tue, Jan 24, 2012 at 4:09 PM, Michael wrote: > Hi all, > > I have data which are u

Re: [R] Interactive map graphics.

2012-01-24 Thread Richard M. Heiberger
On Tue, Jan 24, 2012 at 5:10 PM, Kevin Burton wrote: > I am stuck with R 2.14.0 for now because the COM interface that I am using > (RandFriends) is still on 2.14.0. When I try to install this package (via > the script) I get: RAndFriends had 2.14.1 available several weeks ago. It is there as R

Re: [R] Interactive map graphics.

2012-01-24 Thread Kevin Burton
I am stuck with R 2.14.0 for now because the COM interface that I am using (RandFriends) is still on 2.14.0. When I try to install this package (via the script) I get: packages 'qtbase', 'qtpaint' are not available (for R version 2.14.0) Is there an alternate way to install these packages?

[R] detecting noise in data?

2012-01-24 Thread Michael
Hi all, I have data which are unfortuantely comtaminated by noise. We knew that the noise is at different level than the correct data, i.e. the noise data can be easily picked out by human eyes. It looks as if there are two people that generated the two very different data with different mean le

Re: [R] Calling function in DLL using .C

2012-01-24 Thread Alex van der Spek
Sorry, this works www.zdoor.home.xs4all.nl Thank you, Alex van der Spek On 01/24/2012 07:21 PM, Duncan Murdoch wrote: On 24/01/2012 11:55 AM, Alex van der Spek wrote: Uploaded the DLL here: http://www.filefactory.com/file/c2c56ad/n/Planck.dll I get: 403 Forbidden Request forbidden by

Re: [R] read.table: how to ignore errors?

2012-01-24 Thread Sam Steingold
> * William Dunlap [2012-01-24 21:47:39 +]: > >> >> Oh, yeah, a reproducible example: >> >> >> >> read.csv from >> >> = >> >> a,b >> >> 1,2 >> >> 3,4 >> >> 5,,6 >> >> 7,8 >> >> = >> >> I want to be able to extract the data frame >> >> a b >> >> 1 1 1 > The previous line should be '

Re: [R] reshape dataframe to array (pivot table)

2012-01-24 Thread Jean V Adams
Johannes Radinger wrote on 01/24/2012 10:15:29 AM: > Hello, > > I would like to reshape a dataframe into an array. This is kind a > similar task as Excel performs with a Pivot table. To illustrate it: > > LOC <- factor(c(1,2,2,3,1,1)) > SPEC1 <- c(0,0,23,0,12,11) > SPEC2 <- c(1,2,0,0,0,4) > >

Re: [R] Solving Equations

2012-01-24 Thread Carl Witthoft
It was supposed to be a joke :-( On 1/24/12 4:15 PM, Gabor Grothendieck wrote: On Tue, Jan 24, 2012 at 4:07 PM, Carl Witthoft wrote: Like the t-shirt says, "There's no place like 127.0.0.1 " Though I wasn't familiar with this I check the repositories list and CRAN (extras) is selected in

Re: [R] read.table: how to ignore errors?

2012-01-24 Thread William Dunlap
> >> Oh, yeah, a reproducible example: > >> > >> read.csv from > >> = > >> a,b > >> 1,2 > >> 3,4 > >> 5,,6 > >> 7,8 > >> = > >> I want to be able to extract the data frame > >> a b > >> 1 1 1 The previous line should be '1 1 2', right? > >> 2 3 4 > >> 3 7 8 Have you tried using count.f

Re: [R] read.table: how to ignore errors?

2012-01-24 Thread Sam Steingold
> * Duncan Murdoch [2012-01-24 16:00:14 -0500]: > > On 24/01/2012 3:45 PM, Sam Steingold wrote: >> I get this error from read.table(): >> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : >>line 234 did not have 8 elements >> The error is genuine (an extra field sep

Re: [R] read.table: how to ignore errors?

2012-01-24 Thread Rolf Turner
On 25/01/12 09:45, Sam Steingold wrote: I get this error from read.table(): Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 234 did not have 8 elements The error is genuine (an extra field separator between 1st and 2nd element). 1. is there a way to see this

Re: [R] Looping and actual variable names

2012-01-24 Thread Jean V Adams
Gordon, Alan wrote on 01/24/2012 09:15:31 AM: > Dear R users, > > I'm a new user to R and have a data set consisting of a number of > variables (in a data frame). I wish to carry out a regression > analysis of the first variable against all the rest in turn. I have > used the following code to

Re: [R] read.table: how to ignore errors?

2012-01-24 Thread R. Michael Weylandt
Given your domain name, you might also get some use out of the system() and system2() commands which allow the passing of strings to the OS command line (and thus the use of tools like grep/sed/awk within R) E.g., an idiom I use pretty frequently for interactive data analysis: (not really related,

Re: [R] POSIXct value display incorrect for some values

2012-01-24 Thread Curt Seeliger
Yes, you're right about this being a floating point issue. I guess I wasn't clear enough that this was already understood. I'd have responded earlier the response somehow missed my mailbox. My question is rather whether there is a work around for correctly displaying POSIXct values as charact

Re: [R] Solving Equations

2012-01-24 Thread Gabor Grothendieck
On Tue, Jan 24, 2012 at 4:07 PM, Carl Witthoft wrote: > Like the t-shirt says,  "There's no place like 127.0.0.1 " > > > > > > Though I wasn't familiar with this I check the repositories list and CRAN > (extras) is selected in my installation (R-2.14.1). By the way, when trying > Ryacas after wha

Re: [R] sampling weights in package lme4

2012-01-24 Thread peter dalgaard
On Jan 24, 2012, at 20:41 , Thomas Lumley wrote: > It's not meant for sampling weights. It's meant for precision > weights. How best to include sampling weights in mixed models is a > research problem at the moment, but you can rely on getting the wrong > answer if you just use the weights= arg

Re: [R] Solving Equations

2012-01-24 Thread Carl Witthoft
Like the t-shirt says, "There's no place like 127.0.0.1 " Though I wasn't familiar with this I check the repositories list and CRAN (extras) is selected in my installation (R-2.14.1). By the way, when trying Ryacas after what seemed to be a successful install, for a simple example of x <

Re: [R] drop columns whose rows are all 0

2012-01-24 Thread Rolf Turner
On 25/01/12 05:14, Francisco wrote: Hello, I have a dataset with 40 variables, some of them are always 0 (each row). I would like to make a subset containing only the columns which values are not all 0, but I don't know how to do it. I tried: for(cut_column in 1:40) { if(sum(dataset[,cut_co

Re: [R] read.table: how to ignore errors?

2012-01-24 Thread Duncan Murdoch
On 24/01/2012 3:45 PM, Sam Steingold wrote: I get this error from read.table(): Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 234 did not have 8 elements The error is genuine (an extra field separator between 1st and 2nd element). 1. is there a way to see

Re: [R] drop columns whose rows are all 0

2012-01-24 Thread Gregorio R. Serrano
dataset.1 <- dataset[, apply(dataset, 2, sum)>0] Gregorio R. Serrano 2012/1/24 Francisco > Hello, > I have a dataset with 40 variables, some of them are always 0 (each row). > I would like to make a subset containing only the columns which values are > not all 0, but I don't know how to do it.

[R] read.table: how to ignore errors?

2012-01-24 Thread Sam Steingold
I get this error from read.table(): Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 234 did not have 8 elements The error is genuine (an extra field separator between 1st and 2nd element). 1. is there a way to see this bad line 234 from R without diving into t

Re: [R] function for grouping

2012-01-24 Thread Petr Savicky
On Tue, Jan 24, 2012 at 07:05:37PM +0100, Petr Savicky wrote: > On Tue, Jan 24, 2012 at 05:19:42PM +, yan jiao wrote: > > Dear All, > > > > I'm wondering if there is a R function could give me all the > > combinations of the grouping/cluster result, given the number of the groups. > > e.g. >

[R] Error from Brugs "'r for windows gui front-end has stopped working''

2012-01-24 Thread Jin Minming
Dear all, I just try to run the example in R brugs packages, but not only once. Loop is added in this example. After several times (7, 11, or other random number), there is an error message "r for windows gui front-end has stopped working". This happened in two laptops with windows 7 and vista.

Re: [R] Question

2012-01-24 Thread Marc Schwartz
On Jan 24, 2012, at 11:17 AM, Taylor, Brian wrote: > We were looking at conducting a pilot program with Dell to virtualize our lab > environments. We are specifically looking at Dell/Citrix provisioning > servers. The OS in this setup is streamed from the server on every boot. I > was curio

Re: [R] R not giving significance tests for coefficients/estimates?

2012-01-24 Thread Thomas Lumley
On Tue, Jan 24, 2012 at 9:36 AM, Bert Gunter wrote: > 1. It's an interaction in a formula not a multiplication. > > > 2. Read the Help file. It says to use ltsreg not lmsreg. > > 3. But no P values will be given anyway. The reason is that exact > distributions and therefore reliable P values or CI

Re: [R] sampling weights in package lme4

2012-01-24 Thread Thomas Lumley
On Tue, Jan 24, 2012 at 6:19 PM, Mohd masood wrote: > > Dear All > I am trying to include sampling weights in multilavel regression analysis > using packege lme4 using following codes > > print(fm1 <- lmer(DC~sex+age+smoker+alcohol+fruits(1|setting), > dataset,REML = FALSE), corr = FALSE) > prin

[R] Question

2012-01-24 Thread Taylor, Brian
We were looking at conducting a pilot program with Dell to virtualize our lab environments. We are specifically looking at Dell/Citrix provisioning servers. The OS in this setup is streamed from the server on every boot. I was curious if the R Project had any licensing stipulations in this ty

Re: [R] Transparent color ramp problem

2012-01-24 Thread david99
I think you can do this in hexadecimal. To see this, compare the HEX output from rgb(1,0,0) and rgb(1,0,0,0.5): #FF #FF80 They differ only by the addition of the alpha digits hex 80 which are (almost) half way between 00 and FF. Making a non-transparent scale transparent is thus just a

Re: [R] Checking for invalid dates: Code works but needs improvement

2012-01-24 Thread Rui Barradas
Hello, Point 3 is very simple, instead of 'print' use 'cat'. Unlike 'print' it allows for several arguments and (very) simple formating. { cat("Error: Invalid date values in", DateNames[[i]], "\n", TestDates[DateNames][[i]][TestDates$Invalid==1], "\n") } Rui Barradas -- View

Re: [R] Interactive map graphics.

2012-01-24 Thread Tengfei Yin
Hi Kevin, I haven't watched through the video yet, but I guess It's not ggplot2, just like David pointed out, it's actually using a different graphic engine, implemented in packages qtbase/qtpaint, which are hosted on Biocondcutor, to install them, please run source("http://www.bioconductor.org/

Re: [R] Interactive map graphics.

2012-01-24 Thread David Winsemius
On Jan 24, 2012, at 1:15 PM, Kevin Burton wrote: I just watched http://www.youtube.com/watch?v=iSXNfZESR5I and there is a section where Hadley Wickham showed demonstrated a county map of the US that was interactive. This is exactly what I would like. I have downloaded ggplot2 but sti

Re: [R] function for grouping

2012-01-24 Thread Petr Savicky
On Tue, Jan 24, 2012 at 05:19:42PM +, yan jiao wrote: > Dear All, > > I'm wondering if there is a R function could give me all the > combinations of the grouping/cluster result, given the number of the groups. > e.g. > 3 objects: x1 x2 x3, number of groups is 2 > so the result will be > group

Re: [R] reshape dataframe to array (pivot table)

2012-01-24 Thread Rainer Schuermann
Hi, I wouldn't know how to fill the data into the array form you want, but you can get the aggregated data with dfm <- melt( df ) dfc <- cast( dfm, LOC ~ variable, sum ) > dfc LOC SPEC1 SPEC2 1 123 5 2 223 2 3 3 0 0 Hope this helps as a first step! Rgds, Raine

Re: [R] Calling function in DLL using .C

2012-01-24 Thread Duncan Murdoch
On 24/01/2012 11:55 AM, Alex van der Spek wrote: Uploaded the DLL here: http://www.filefactory.com/file/c2c56ad/n/Planck.dll I get: 403 Forbidden Request forbidden by administrative rules. Duncan Murdoch Appreciate if you can check to see if anything is wrong with this DLL. I use dumpbi

[R] Interactive map graphics.

2012-01-24 Thread Kevin Burton
I just watched http://www.youtube.com/watch?v=iSXNfZESR5I and there is a section where Hadley Wickham showed demonstrated a county map of the US that was interactive. This is exactly what I would like. I have downloaded ggplot2 but still failed to find out how to even read in and plot some

Re: [R] Moving-Tiles Bootstrap

2012-01-24 Thread Kim Elmore
I wish to proffer my sincere apologies to both you and the list. I had not seen my posting appear -- it was initially held for moderator approval, but I never saw that it was released. During the subscription process, I had used an incorrect e-mail address and so withdrew the post. Within my su

Re: [R] Moving-Tiles Bootstrap

2012-01-24 Thread Jeff Newmiller
A) Reposting the same message as a separate thread is bad netiquette. B) Posting HTML email on this list is strongly discouraged. C) You probably ought to read the posting guide. D) This is a list about using R. Posting theoretical questions without corresponding R code that illustrates what ho

[R] function for grouping

2012-01-24 Thread yan jiao
Dear All, I'm wondering if there is a R function could give me all the combinations of the grouping/cluster result, given the number of the groups. e.g. 3 objects: x1 x2 x3, number of groups is 2 so the result will be group1:x1,x2; group2: x3 group1: x1;group2: x2,x3 group1: x1,x3;group2: x2 m

Re: [R] Calling function in DLL using .C

2012-01-24 Thread Alex van der Spek
Uploaded the DLL here: http://www.filefactory.com/file/c2c56ad/n/Planck.dll Appreciate if you can check to see if anything is wrong with this DLL. I use dumpbin to look at what is in the exports table of the DLL. No reason for concerns there. I can work with this DLL from both VBA and Python. Pyt

Re: [R] Splitting up large set of survey data into categories

2012-01-24 Thread ak13
Hi Tal, thank you very much for your reply. The xts-dataframe I am using is like: example <- as.data.frame(structure(c(" 1", " 2", " 1", " 2", " 1", " 1", " 2", " 1", " 2", " 1", " 2", " 3", " 1", " 1", " 2", " 2", " 3", " 1", " 2", " 2", " 1", " 2", " 1", " 1", " 2", NA, " 2", NA, NA, " 1", "

[R] Checking for invalid dates: Code works but needs improvement

2012-01-24 Thread Paul Miller
Hello Everyone, Still new to R. Wrote some code that finds and prints invalid dates (see below). This code works but I suspect it's not very good. If someone could show me a better way, I'd greatly appreciate it. Here is some information about what I'm trying to accomplish. My sense is that th

Re: [R] Column name containing "-"

2012-01-24 Thread Bert Gunter
Ivan: AFAICS you did not read my post carefully enough. Unquoted improper identifiers trigger an error because the input cannot be parsed. It has nothing to do with data.frame() .(**R EXPERTS, PLEASE CORRECT IF WRONG**). Unquoted LEGAL names are accepted because that's how R works -- they can be p

Re: [R] drop columns whose rows are all 0

2012-01-24 Thread Jorge I Velez
Try also dataset[, colSums(dataset == 0) != nrow(dataset)] HTH, Jorge.- On Tue, Jan 24, 2012 at 11:14 AM, Francisco <> wrote: > Hello, > I have a dataset with 40 variables, some of them are always 0 (each row). > I would like to make a subset containing only the columns which values are > not

Re: [R] Adding text to multiple plots

2012-01-24 Thread David Winsemius
On Jan 24, 2012, at 11:20 AM, Katarzyna Sawicka wrote: Dear David, Thanks for your reply. However, I can't see how this is a case. The table is read into R from .csv file. The column Date has a factor format then. If I don't change it to as.Date format and use the same code, the 'text' f

Re: [R] drop columns whose rows are all 0

2012-01-24 Thread Justin Haynes
> dataset<-data.frame(a=1:10,b=c(0,0,0,1,0,0,0,0,1,0),c=rep(0,10)) > apply(dataset,2,function(x) all(x==0)) a b c FALSE FALSE TRUE > dataset[,!apply(dataset,2,function(x) all(x==0))] a b 1 1 0 2 2 0 3 3 0 4 4 1 5 5 0 6 6 0 7 7 0 8 8 0 9 9 1 10 10 0 On Tue, Ja

Re: [R] Column name containing "-"

2012-01-24 Thread R. Michael Weylandt
Sorry, I meant check.names = FALSE (d'oh!) Michael On Tue, Jan 24, 2012 at 11:33 AM, R. Michael Weylandt wrote: > I've usually understand the restrictions on syntactic names as being > tied to the parser. > > E.g., how could R tell the difference between > > d <- data.frame(a = 3, `a-2` = 3, che

Re: [R] Column name containing "-"

2012-01-24 Thread R. Michael Weylandt
I've usually understand the restrictions on syntactic names as being tied to the parser. E.g., how could R tell the difference between d <- data.frame(a = 3, `a-2` = 3, check.names = TRUE) d$a-2 ## Equal to 1 or 3 ? One of those strange eval things that makes alot of sense for an interactive lan

Re: [R] Adding text to multiple plots

2012-01-24 Thread Katarzyna Sawicka
Dear David, Thanks for your reply. However, I can't see how this is a case. The table is read into R from .csv file. The column Date has a factor format then. If I don't change it to as.Date format and use the same code, the 'text' function print the mean by the maximum on y ax regardless to th

Re: [R] Writing a function to return column position XXXX

2012-01-24 Thread David Winsemius
On Jan 24, 2012, at 11:07 AM, Dan Abner wrote: Hi everyone, I am using Michael's approach (grepl()) to identify which columns containing $ signs. I was hoping to incorporate this into a line of code that would automatically 1) find which columns contain $ signs, 2) strip the $ and commas, and

Re: [R] Column name containing "-"

2012-01-24 Thread Ivan Calandra
Bert, Thank you for correcting my inaccuracy. A quick look at the original question might help you understand what I meant: d<- data.frame(x = c(0, 1)) d<- data.frame(d, y = c(0,1)) names(d)[2]<- "a.-5" d x a.-5 1 00 2 11 d1<- data.frame(d, y = c(0,1)) d1 x a..5 y 1 00 0 2 11

[R] drop columns whose rows are all 0

2012-01-24 Thread Francisco
Hello, I have a dataset with 40 variables, some of them are always 0 (each row). I would like to make a subset containing only the columns which values are not all 0, but I don't know how to do it. I tried: for(cut_column in 1:40) { if(sum(dataset[,cut_column])!=0) {

Re: [R] debug package: mtrace fails

2012-01-24 Thread deivit
I'll try, Here is a piece of code it fails for me, the error I get is always the same, and it happens in most of my functions. The problem is always the same trying to execute 'mtrace'. Thanks! --- execution -- > mtrace(index_remap) Error in x[[i]] : subscript out of

[R] Looping and actual variable names

2012-01-24 Thread Gordon, Alan
Dear R users, I'm a new user to R and have a data set consisting of a number of variables (in a data frame). I wish to carry out a regression analysis of the first variable against all the rest in turn. I have used the following code to do this dd<-read.table("for loop.txt",header=T) for (j in

[R] reshape dataframe to array (pivot table)

2012-01-24 Thread Johannes Radinger
Hello, I would like to reshape a dataframe into an array. This is kind a similar task as Excel performs with a Pivot table. To illustrate it: LOC <- factor(c(1,2,2,3,1,1)) SPEC1 <- c(0,0,23,0,12,11) SPEC2 <- c(1,2,0,0,0,4) df <- data.frame(LOC,SPEC1,SPEC2) # original dataframe a <- array(NA,d

Re: [R] Help: read a proportion of high through-put data

2012-01-24 Thread Chee Chen
Hi, Michael, Got it, thank you so much! Chee From: R. Michael Weylandt Sent: Monday, January 23, 2012 11:33 PM To: r-help ; Chee Chen Subject: Re: [R] Help: read a proportion of high through-put data Ok, it seems to have worked on my machine as well, but for some levels you didn't mention be

Re: [R] Normalization in R

2012-01-24 Thread Juliet Hannah
For quantile normalization check out normalize.quantiles in the Biocondcutor preProcess package. Also, there is a Bioconductor mailing list for future where these topics are discussed. http://svitsrv25.epfl.ch/R-doc/library/preprocessCore/html/normalize.quantiles.html On Sat, Jan 21, 2012 at 7:3

Re: [R] Writing a function to return column position XXXX

2012-01-24 Thread Dan Abner
Hi everyone, I am using Michael's approach (grepl()) to identify which columns containing $ signs. I was hoping to incorporate this into a line of code that would automatically 1) find which columns contain $ signs, 2) strip the $ and commas, and 3) convert the result to a numeric vector. I have

Re: [R] Splitting up large set of survey data into categories

2012-01-24 Thread Tal Galili
Hi andreas, Please give a sample of your data, and how you want it to be after the manipulation. Consider using ?dput Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | w

Re: [R] debug package: mtrace fails

2012-01-24 Thread Tal Galili
Hi Deivit, Can you offer a self contained example of r code when the function fails for you? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (He

Re: [R] Column name containing "-"

2012-01-24 Thread Bert Gunter
Ivan: On Tue, Jan 24, 2012 at 6:47 AM, Ivan Calandra wrote: > By "it works anyway", I mean that you can have a dash in a column name, > there is no error or even warning. > I guess that some functions would throw an error or warning, depending on > the requirements, but data.frame() doesn't. Thi

[R] Moving-Tiles Bootstrap

2012-01-24 Thread Kim Elmore
I wish to perform moving tiles bootstrap resampling on some gridded data meteorological data. I've many years experience with S-Plus, but it has no way to perform a moving-tiles bootstrap. Within R I've learned how to use quadratresample() with the spatstats package and would be happy to simply

[R] lattice wireframe_box around picture

2012-01-24 Thread Branimir Hackenberger
I am using the wireframe function from lattice package. The problem that I have is very interesting. Namely, this is my code: x= seq(-pi, pi, len = 20) y=seq(-pi, pi, len = 20) xyz= expand.grid(x = x, y = y) xyz$z=sin(sqrt(xyz$x^2 +xyz$y^2)) trellis.par.set("axis.line",list(col="transpa

Re: [R] Adding text to multiple plots

2012-01-24 Thread David Winsemius
On Jan 24, 2012, at 8:12 AM, ksaw wrote: Dear R-helpers, I am trying to add an information about the mean value for each variable within each plot by adding text to the multiple plots in this way: par(mfrow=c(2,2)) df$Date <- as.Date(df$Date, format="%d/%m/%Y") for (i in 2:5){ plo

  1   2   >