[R] bivariate localpcf in Spatstat

2012-08-01 Thread Grace Hensen
Hi, I would like to know if there is a way to carry out a bivariate (e.g., between individuals of two tree species) local pair correlation function in Spatstat. There is currently a function localpcf for univariate data but I have not found one for bivariate data and was wondering if there is way

Re: [R] metafor package, proportions: single groups wrt to a categorical dependent variable

2012-08-01 Thread Dushanthi Pinnaduwage
Thanks for the reply. Goal of my meta analysis is to compare 2 different surgical procedures to fix the same problem. Data (after systematic search) are collected from studies with one or the other procedure applied. There are a couple of outcome variables that measure the effetivenss of

Re: [R] Zoo panel function

2012-08-01 Thread Gene Leynes
Achim, Thank you for your response, and for your work on the zoo package in general. Also, that implementation of the color scheme looks great. Frankly, I can't remember exactly what I was originally trying to accomplish for this particular problem, but I think that your suggestion of reviewing

[R] Why the result is coming as NULL?

2012-08-01 Thread Sri krishna Devarayalu Balanagu
Why the result is coming as NULL. Can anyone help. I want to find the outliers for a reference setwd(D:/AZ) library(RODBC) cdb_cnct - odbcConnectExcel(Book1.xls) cdb_frame - sqlFetch(cdb_cnct, Sheet1) odbcClose(cdb_cnct) rm(cdb_cnct) x- cdb_frame$Publication =1990 cdb_frame$Publication =2012

[R] Date period

2012-08-01 Thread Васильченко Александр
Hello I have dataframe How to remove dates in hourly time seriesThe example time series likedate value 2000-01-05 00:00:00 1.0 2000-01-05 01:00:00 1.0 2000-01-05 05:00:00 3.6 2000-01-05 06:00:00 3.6 2000-01-05 07:00:00

Re: [R] Only one class shown in SVM plot?

2012-08-01 Thread Meffy
Thanks a lot! After thinking about it it definitely makes sense ! Greetings, Matthias -- View this message in context: http://r.789695.n4.nabble.com/Only-one-class-shown-in-SVM-plot-tp4637782p4638629.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Why the result is coming as NULL?

2012-08-01 Thread Julien Moeys
Not sure, but maybe check the name of the column(s) you are retrieving you may get a NULL value if the column name is misspelled R example: ## -- df - data.frame( Publication = 1991:2000, Reference = LETTERS[1:10] ) df[ 2, References ] # NULL

Re: [R] Date period

2012-08-01 Thread Pascal Oettli
Hello, You can try the following: x - read.table(text=2000-01-05 00:00:00 1.0 2000-01-05 01:00:00 1.0 2000-01-05 05:00:00 3.6 2000-01-05 06:00:00 3.6 2000-01-05 07:00:00 2.2 2000-01-05 08:00:00 2.2 2000-01-05 09:00:00 2.2

Re: [R] Why the result is coming as NULL?

2012-08-01 Thread Jessica Streicher
I assume result means the invalid variable. works with sample data frame i made, so please provide an example of cdb_frame. You can use dput(cdb_frame) for that, or dput(head(cdb_frame)) if you have a lot of data. For example it could be that $Publication is a string, not numeric. On

[R] Optimal cut off with ROC (Epi package)

2012-08-01 Thread Luigi
Dear all, I would like to calculate the optimal cut off (threshold) of a test using the Epi package. Here I am presenting some data based on the output of two tests. I am interested in identifying the optimal cut off and its 95% CI. Running the ROC() function with the Epi package I obtain a

[R] Cross validation for nls function

2012-08-01 Thread mael
Hi, I've written a logistic function using nls and I'd like to do cross validation for this. Is there a package for that? Below is an example of my data and the function. N terms are presence/absence data and the response is succesful/failed data. y1-sample(0:1,100,replace=T)

[R] How to increase lenght of axis according input data?

2012-08-01 Thread Manish Gupta
Hi, I am working on barplot. I need to plot x-axis but scale on x axis is very upto 15 while my data is upto 19. pdf(image.pdf, width=10 , height =13) par(mar=c(5,22.5,2,2)) barplot(t(data[,2:3]), beside=TRUE, col=c(rgb(.537, .769, .933),rgb(.059, .412, .659)), width = 1,

[R] how to calculate seasonal mean for temperatures

2012-08-01 Thread jeff6868
Hello everybody, I need to calculate seasonal means with temperature data for my work. I have 70 files coming from weather stations, which looks like this for example: startdate - as.POSIXct(01/01/2006, format = %d/%m/%Y) enddate - as.POSIXct(05/01/2006, format = %d/%m/%Y) date - seq(from =

Re: [R] metafor package, proportions: single groups wrt to a categorical dependent variable‏

2012-08-01 Thread Viechtbauer Wolfgang (STAT)
Dear Dushanthi, Please keep your e-mails on the R-Help list, where Michael has already given you some excellent advice. As Michael already explained, metafor can handle proportions, but does not have any specific functionality for categorical variables with more than 2 levels (at the moment).

[R] need help on stkcd reading

2012-08-01 Thread delvin008 delta
Hi, all: This is the first time I use mail-list for help and I'm a student from Chinese. So forgive my poor English skill. Here is the question: I have an excel file contains some stkcd information. The stkcd is a string fill with numbers, e.g 02. When i use sqlFetch function from

Re: [R] need help on stkcd reading

2012-08-01 Thread Prof Brian Ripley
On 01/08/2012 10:11, delvin008 delta wrote: Hi, all: This is the first time I use mail-list for help and I'm a student from Chinese. So forgive my poor English skill. Here is the question: I have an excel file contains some stkcd information. The stkcd is a string fill with

[R] repeating a function across a data frame

2012-08-01 Thread JenniferH
Hello everyone. Like others on this list, I'm new to R, and really not much of a programmer, so please excuse any obtuse questions! I'm trying to repeat a function across all possible combinations of vectors in a data frame. I'd hugely appreciate any advice! Here's what I'm doing: I have some

Re: [R] How to increase lenght of axis according input data?

2012-08-01 Thread Anders Ellern Bilgrau
Hello, Here's a quick and dirty solution. By setting axes = FALSE in the barplot plot arguments we suppress the axes. You then use the axis function afterward to draw the desired axis. Below, i have also used the pretty function. Have a look at this: data - rbind(c(3,4,6), c(5,15,19))

[R] Why the error is coming while extracting the data from sheet?

2012-08-01 Thread Sri krishna Devarayalu Balanagu
Even though the sheet name Publication exists. The error is coming. Can anyone help? library(RODBC) cdb_cnct - odbcConnectExcel(Copy of AZIF_DC_GVK_NSCLC_MSALL_287papers_02072012_141450_v1_4.xls) cdb_frame - sqlFetch(cdb_cnct, Publication) odbcClose(cdb_cnct) Error in odbcTableExists(channel,

Re: [R] how to calculate seasonal mean for temperatures

2012-08-01 Thread Petr PIKAL
Hi Something like aggregate(DF$data, list(quarters(DF$date), format(DF$date, %Y)), mean) Regards Petr Hello everybody, I need to calculate seasonal means with temperature data for my work. I have 70 files coming from weather stations, which looks like this for example: startdate -

[R] Optimize a function with Discrete inputs

2012-08-01 Thread loyolite270
Hi I need to optimize the below function: a=function(x){ A=x[1] B=x[2] C=B-A return(C) } I need to optimize the above function such that x can be any combination of these number (0,3,5,8) of vector length 2 (i.e) x can be (3,0), (5,0), (8,0), (3,5), (3,8), (5,8), .. etc can

Re: [R] repeating a function across a data frame

2012-08-01 Thread Petr PIKAL
Hi did you find function dist? It seems that it can do directly what you want. Regards Petr Hello everyone. Like others on this list, I'm new to R, and really not much of a programmer, so please excuse any obtuse questions! I'm trying to repeat a function across all possible

Re: [R] how to calculate seasonal mean for temperatures

2012-08-01 Thread jeff6868
Thank you both for your answers. I found a best way to delete the first 2 months (Jan + Feb) and the last month (Dec), which should work everytime: DF$year - as.numeric(format(DF$Day, format = %Y)) DF$month - as.numeric(format(DF$Day, format = %m)) # delete first 2 months for(i in DF[1,3]) #

Re: [R] Zoo panel function

2012-08-01 Thread Gabor Grothendieck
On Wed, Aug 1, 2012 at 12:40 AM, Gene Leynes gley...@gmail.com wrote: Achim, Thank you for your response, and for your work on the zoo package in general. Also, that implementation of the color scheme looks great. Frankly, I can't remember exactly what I was originally trying to accomplish

Re: [R] Zoo panel function

2012-08-01 Thread Gabor Grothendieck
On Wed, Aug 1, 2012 at 7:31 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Aug 1, 2012 at 12:40 AM, Gene Leynes gley...@gmail.com wrote: Achim, Thank you for your response, and for your work on the zoo package in general. Also, that implementation of the color scheme looks

Re: [R] Date period

2012-08-01 Thread Rui Barradas
Hello, Try the following. dat - structure(list(date = c(2000-01-05 00:00:00, 2000-01-05 01:00:00, 2000-01-05 05:00:00, 2000-01-05 06:00:00, 2000-01-05 07:00:00, 2000-01-05 08:00:00, 2000-01-05 09:00:00, 2000-01-05 10:00:00, 2000-01-05 11:00:00, 2000-02-05 00:00:00, 2000-02-05 01:00:00,

Re: [R] drawing a specific plane with scatterplot3d

2012-08-01 Thread Uwe Ligges
On 31.07.2012 21:14, Duncan Murdoch wrote: On 12-07-31 2:54 PM, Andras Farkas wrote: Dear All, using the example from the package scatterplot3d I created a 3d plot as follows: x -rnorm(500,50,2) y -rnorm(500,5,1) z -rnorm(500,6,1) scatterplot3d(x, y, z, highlight.3d=TRUE,

Re: [R] Why the error is coming while extracting the data from sheet?

2012-08-01 Thread Jeff Newmiller
We cannot help you if you don't give us enough information to do so. Please use the dput function to give us a copy of your cdb_frame as others have already requested. You may also find the str function helpful in diagnosing your own problems.

Re: [R] repeating a function across a data frame

2012-08-01 Thread Jean V Adams
As Petr suggests, the dist() function will do much of the work for you. For example ... # example matrix of data nsamples - 40 nreadings - 46 dat - matrix(runif(nsamples*nreadings), nrow=nsamples) # Euclidean distance between the ROWS of dat distance - dist(dat) Jean JenniferH

Re: [R] length of variable in mlogit

2012-08-01 Thread Lee van Cleef
Ingmar, many thanks. I get that one from R: Error in model.frame.default(terms(formula, lhs = lhs, rhs = rhs, data = data), : variable lengths differ (found for 'X') X is the variable I have used. Any comment would be much appreciated. Best regards! -- View this message in context:

[R] help with a regression problem

2012-08-01 Thread R Heberto Ghezzo, Dr
Hello, I have a big data frame where consecutive time dates and corresponding observed values for each subject (ID) are on a line. I want to compute the linear slope for each subject. I would like to use apply but I do not know how to express the corresponding function. An example using a loop

Re: [R] how to calculate seasonal mean for temperatures

2012-08-01 Thread jeff6868
It's working now! The problem was not for winter, but with the with you had in your object DF$season. I got an error: invalid 'envir' argument. I removed it and now it seems to be OK. Thank you very much for your help ricardo. -- View this message in context:

Re: [R] How to increase lenght of axis according input data?

2012-08-01 Thread Jean V Adams
You could use the xlim argument to barplot. For example, barplot(t(data[,2:3]), beside=TRUE, xlim=c(0, 20), col=c(rgb(.537, .769, .933), rgb(.059, .412, .659)), width=1, horiz=TRUE, cex.names=.9, border =white, las=1, cex.axis=1, cex.lab=1.2) Jean Manish Gupta

Re: [R] how to calculate seasonal mean for temperatures

2012-08-01 Thread Rui Barradas
Hello, See if this is it. fun - function(DF, FUN = mean){ month - as.integer(format(DF$date, format=%m)) year - format(DF$date, format=%Y) month[month %in% 1:2] - 13 DF$season - NA DF$season[month %in% 12:13] - paste(year[month %in% 12:13], Winter) DF$season[month %in%

Re: [R] help with a regression problem

2012-08-01 Thread Sarah Goslee
Hi, On Wed, Aug 1, 2012 at 9:06 AM, R Heberto Ghezzo, Dr heberto.ghe...@mcgill.ca wrote: Hello, I have a big data frame where consecutive time dates and corresponding observed values for each subject (ID) are on a line. I want to compute the linear slope for each subject. I would like to

Re: [R] drawing a specific plane with scatterplot3d

2012-08-01 Thread Duncan Murdoch
On 12-08-01 8:42 AM, Uwe Ligges wrote: On 31.07.2012 21:14, Duncan Murdoch wrote: On 12-07-31 2:54 PM, Andras Farkas wrote: Dear All, using the example from the package scatterplot3d I created a 3d plot as follows: x -rnorm(500,50,2) y -rnorm(500,5,1) z -rnorm(500,6,1) scatterplot3d(x, y,

Re: [R] help with a regression problem

2012-08-01 Thread Jean V Adams
R Heberto Ghezzo, Dr heberto.ghe...@mcgill.ca wrote on 08/01/2012 08:06:30 AM: Hello, I have a big data frame where consecutive time dates and corresponding observed values for each subject (ID) are on a line. I want to compute the linear slope for each subject. I would like to use apply

Re: [R] Error message: $ operator is invalid for atomic vectors

2012-08-01 Thread Rui Barradas
Hello, Because there's a bug in the way I read the data: data.matrix is not well used here, it transforms all variables in character vectors and may cause problems such as 9 10 [1] FALSE 9 10 [1] TRUE It was David Winsemius that pointed this out. As a side effect, data.matrix returns a

Re: [R] drawing a specific plane with scatterplot3d

2012-08-01 Thread Uwe Ligges
On 01.08.2012 15:28, Duncan Murdoch wrote: On 12-08-01 8:42 AM, Uwe Ligges wrote: On 31.07.2012 21:14, Duncan Murdoch wrote: On 12-07-31 2:54 PM, Andras Farkas wrote: Dear All, using the example from the package scatterplot3d I created a 3d plot as follows: x -rnorm(500,50,2) y

Re: [R] help with a regression problem

2012-08-01 Thread Eik Vettorazzi
Hi, maybe working with a data.frame in long format is an option - then you can use e.g. lmList and so on up to mixed models, depending on your final goals of analyses (e.g. check for differential slopes). vmat-matrix(c(X1,X2,X3,X4,Y1,Y2,Y3,Y4),nrow=2,byrow=T)

Re: [R] Help with NaN when 0 divided by 0

2012-08-01 Thread Jennifer Sabatier
Hi Everyone, Thanks so much for all your suggestions! All of these worked but David's was best suited for my purposes, considering it was something happens sporadically. I don't do expenditure analyses often as I mostly do run of the mill survey analysis, but this will come in handy for the

Re: [R] Optimize a function with Discrete inputs

2012-08-01 Thread Eik Vettorazzi
Hi, not sure if that is what you are looking for, but have a look at cmb-t(combn(c(0,3,5,8),2)) #get all pairs of combinations cbind(cmb,apply(cmb,1,diff)) #for each pair, get the difference cheers Am 01.08.2012 12:29, schrieb loyolite270: Hi I need to optimize the below function:

Re: [R] Optimize a function with Discrete inputs

2012-08-01 Thread Sarah Goslee
combn() gives ordered combinations, while expand.grid() gives all combinations. I'd give worked code but this hints at homework to me. Sarah On Wed, Aug 1, 2012 at 10:23 AM, Eik Vettorazzi e.vettora...@uke.de wrote: Hi, not sure if that is what you are looking for, but have a look at

Re: [R] Help with NaN when 0 divided by 0

2012-08-01 Thread William Dunlap
%/0% - function(x,y) { res - x / y ; res[ is.na(res) ] - 0; return(res) } I think this would be more to the point if the output were set to 0 if the numerator were 0, not if the output would be NA. res[x==0] -0 You may also want to restructure your computations so that the proportion

Re: [R] Subgraph isomorphism using vertex labels

2012-08-01 Thread Gábor Csárdi
Hi, igraph will give you the mappings via vertex ids. If you want to use symbolic vertex names, then attach a vertex attribute called 'name'. Then any vector of numeric vertex ids (v, from graph g) can be converted to vertex names via V(g)$name[v] or the more readable equivalent

[R] Plotting cumsum data using lattice plots according to date conditioned by name.

2012-08-01 Thread Shawn Way
I've been playing around with data like the following: NameDateHrs Way, S 2-3-12 8 Nun, B 2-3-12 9 Way, S 2-4-12 7.5 Nun, B 2-4-12 9 Gus, T 2-5-12 8 I've been able to take this into a data.frame and even develop a cumsum for each of the people d.cum - with(data,by(Hrs,

[R] add text to a plot, create character labels

2012-08-01 Thread Yolande Tra
Hi, I was trying to run the following, where the labels on the x axis are dates and need to be converted to characters. It did not work. Any help would be appreciated. Thanks. text(axTicks(1),par(usr)[3]-2,srt=45,adj=1,labels=as.character(c(2008-01-08,2008-08-10,2008-08-22,2008-09-03,

Re: [R] Optimize a function with Discrete inputs

2012-08-01 Thread peter dalgaard
On Aug 1, 2012, at 16:34 , Sarah Goslee wrote: combn() gives ordered combinations, while expand.grid() gives all combinations. ...and there's one more function that is designed to tabulate a function of two variables over a grid. And yet another one to find which value is max in an array

Re: [R] Date period

2012-08-01 Thread David Winsemius
On Aug 1, 2012, at 5:33 AM, Rui Barradas wrote: Hello, Try the following. dat - structure(list(date = c(2000-01-05 00:00:00, 2000-01-05 01:00:00, 2000-01-05 05:00:00, 2000-01-05 06:00:00, 2000-01-05 07:00:00, 2000-01-05 08:00:00, 2000-01-05 09:00:00, 2000-01-05 10:00:00, 2000-01-05

Re: [R] Date period

2012-08-01 Thread David Winsemius
On Aug 1, 2012, at 12:37 AM, Pascal Oettli wrote: Hello, You can try the following: x - read.table(text=2000-01-05 00:00:00 1.0 2000-01-05 01:00:00 1.0 2000-01-05 05:00:00 3.6 2000-01-05 06:00:00 3.6 2000-01-05 07:00:00 2.2 2000-01-05

Re: [R] add text to a plot, create character labels

2012-08-01 Thread David Winsemius
On Aug 1, 2012, at 9:04 AM, Yolande Tra wrote: Hi, I was trying to run the following, where the labels on the x axis are dates and need to be converted to characters. It did not work. Any help would be appreciated. Thanks. text(axTicks(1),par(usr)[3] There is an unmatched quote in

Re: [R] add text to a plot, create character labels

2012-08-01 Thread Yolande Tra
Thanks for the tip for future typos. Yolande On Wed, Aug 1, 2012 at 1:38 PM, David Winsemius dwinsem...@comcast.netwrote: On Aug 1, 2012, at 9:04 AM, Yolande Tra wrote: Hi, I was trying to run the following, where the labels on the x axis are dates and need to be converted to

[R] read.table() Issue

2012-08-01 Thread Rich Shepard
Yesterday I changed the headers for a couple of columns in data text files and removed hyphens from within character strings, too. When I tried to re-read these data sources using read.table() I encountered an issue I've not before seen. Both files were read almost instantly until yesterday's

Re: [R] read.table() Issue [UPDATE]

2012-08-01 Thread Rich Shepard
On Wed, 1 Aug 2012, Rich Shepard wrote: What might cause this? I restored these two files from last Friday and they are read into R with no problems. So, I'll make one change at a time and see where things break. Will post results when I have them. Rich

Re: [R] read.table() Issue

2012-08-01 Thread William Dunlap
An unmatched quote can make read.table run very slowly when there are lots of lines in the file. E.g., z - rep(A B C, 10^6) z[2] - A \B C # unmatched quote on line 2 tf - tempfile() cat(file=tf, sep=\n, z) system.time(z2 - read.table(tf, skip=2)) # skip bad line user system elapsed

Re: [R] read.table() Issue [RESOLVED]

2012-08-01 Thread Rich Shepard
On Wed, 1 Aug 2012, Rich Shepard wrote: What might cause this? Must be computers acting like computers. Restored files from backup, made changes one at a time, and there are no problems reading them into R data frames. My apologies for taking up space here. Rich

[R] High Dim Gauss Hermite Approximation

2012-08-01 Thread Jie
Dear All, I am writing code of Gauss Hermite Approximation for 2-d case. Suppose I want to calculate the integral \int g(b)*exp(-b' W b) db, where b is a 2 by 1 vector, W is a 2 by 2 positive definite matrix, In order to get the basic form, I need decompose W = L' L, and define x=L*b, i.e. b=

Re: [R] read.table() Issue

2012-08-01 Thread Rich Shepard
On Wed, 1 Aug 2012, William Dunlap wrote: An unmatched quote can make read.table run very slowly when there are lots of lines in the file. E.g., Bill, Yes. Turns out that there was no closing quote on a changed header. I found this by an error message on one data file; the other data file

[R] Upcoming workshop on R, taught by John Fox in Berkeley, CA

2012-08-01 Thread William G. Jacoby
There are still some seats available in the workshop on R that John Fox will be teaching next week in Berkeley, CA. The workshop title is The R Statistical Computing Environment: The Basics and Beyond. It will run from Monday, August 6 through Thursday, August 9 (9:00 a.m. through 5:00 p.m.

Re: [R] Alternating between for loops

2012-08-01 Thread Mercier Eloi
Your code almost gave me a headache. :-/ There are a lot of unnecessary tests and conditions. I tried to break down the code and write the tests that have been done when assigning a variable. I simplified your the first part but cannot guarantee that all criteria are met. #COMMENTS#

Re: [R] Alternating between for loops

2012-08-01 Thread Rui Barradas
Hello, Em 01-08-2012 20:02, Mercier Eloi escreveu: Your code almost gave me a headache. :-/ Agree. There's a good way of avoiding headaches, package formatR, function tidy.source. My simplification is different in many places. A common one is to treat 'observable' as a logical variable,

Re: [R] Alternating between for loops

2012-08-01 Thread David Winsemius
On Aug 1, 2012, at 12:02 PM, Mercier Eloi wrote: Your code almost gave me a headache. :-/ I had a similar reaction. However, my approach might have been to request a more complete verbal description of the data structures being operated on and the methods and assumptions being used.

Re: [R] Error in for-loop

2012-08-01 Thread Jean V Adams
Domi wrote on 08/01/2012 Jul 29, 2012; 8:59am: Hello erverybody, I have a problem with my second for-loop. 1. First i read the tables. datos.mx1 - read.table('PETmx1.csv',head=TRUE,sep=';') datos.min - read.table('PETmin.csv',head=TRUE,sep=';') You are most likely to get good

[R] how to subset the data frame by lines

2012-08-01 Thread Jie Tang
I defined a data.frame by a two-dimensional array. aa = data.frame(rbind( 11:20, 1:10)) aa X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 1 11 12 13 14 15 16 17 18 19 20 2 1 2 3 45 6 78 9 10 Now I want to use the data in the second line of aa which from 1 to 10 to output.But I find

Re: [R] how to subset the data frame by lines

2012-08-01 Thread Jorge I Velez
It is not clear to me from your description what exactly you are trying to do, but to get the numbers in the second line of aa you could use as.numeric(aa[2,]) HTH, Jorge.- On Wed, Aug 1, 2012 at 5:13 PM, Jie Tang wrote: I defined a data.frame by a two-dimensional array. aa =

[R] Best Programming Practices regarding data frames

2012-08-01 Thread Ramiro Barrantes
Hello, I come from using different programming languages (C++, Mathematica, Perl) but have been using R extensively for several months. I see the data frame as a key piece of the language and wanted to inquire people's experience regarding its use. Say you have a data frame D D -

Re: [R] how to subset the data frame by lines

2012-08-01 Thread Bert Gunter
Please read An Introduction to R, which ships with every copy of R, where you will learn how to properly subscript data frames and lists, among other things. There is a reason for such tutorials -- they enable you to avoid elementary mistakes like this and wasting time and effort with such posts

Re: [R] Best Programming Practices regarding data frames

2012-08-01 Thread Bert Gunter
I have no answer to your question, but note: 1. You do not need to return a data frame at all, of course. Most functions do not -- e.g., say, lm() . 2. See ?with and ?within for perhaps relevant functionality. -- Bert On Wed, Aug 1, 2012 at 2:19 PM, Ramiro Barrantes ram...@precisionbioassay.com

Re: [R] optim() for ordered logit model with parallel regression assumption

2012-08-01 Thread Xu Jun
Thanks Michael. Now I switched my approach after doing some google. Following are my new codes: ### library(foreign) readin - read.dta(ordfile.dta, convert.factors=FALSE) myvars - c(depvar, x1, x2, x3) mydta - readin[myvars] # remove all

Re: [R] optim() for ordered logit model with parallel regression assumption

2012-08-01 Thread Bert Gunter
Disclaimer: I have not followed this thread at all, but only wish to note: 1) Indicator variables are (almost?) never needed in R -- that you are fooling with them suggests that there is probably a better approach. 2) Your bols is just least regression, no? -- If so, there are far better ways to

Re: [R] repeating a function across a data frame

2012-08-01 Thread JenniferH
Hi Petr and Jean, thanks very much, problem solved! Really appreciate your help. Jennifer -- View this message in context: http://r.789695.n4.nabble.com/repeating-a-function-across-a-data-frame-tp4638643p4638678.html Sent from the R help mailing list archive at Nabble.com.

[R] finding correlation for lagged values

2012-08-01 Thread arunkumar1111
Hi I've to find the correlation of a variable and lag of other variable. My code currently looks like this y= 32 1 45 26 33 55 15 24 31 78 x=51 69 96 67 71 89 61 42 78 24 lagTimes=2 i want to find the correlation between y and Lag(x,1) and Y Lag(x,2) i'm using loop to find the lag and then

Re: [R] how to calculate seasonal mean for temperatures

2012-08-01 Thread Ricardogg
Here is my approximation: # Creation of the temporal variables DF$year - as.numeric(format(DF$date, format = %Y)) DF$month - as.numeric(format(DF$date, format = %m)) # For years with data from 2006 to 2008 DF_type1 - DF [ - which (year == 2006 month ==1 | year == 2006 month == 2 | year ==

Re: [R] Date period

2012-08-01 Thread arun
Hi, Try this: dat1- read.table(text=2000-01-05 00:00:00  1.0 2000-01-05 01:00:00  1.0 2000-01-05 05:00:00  3.6 2000-01-05 06:00:00  3.6 2000-01-05 07:00:00  2.2 2000-01-05 08:00:00  2.2 2000-01-05 09:00:00  2.2 2000-01-05 10:00:00 

Re: [R] Binary Quadratic Opt?

2012-08-01 Thread khris
Hi Petr, It been sometime since I wrote. But here are the latest developments. When I give the binary linear opt problem to lpSolve optimizer than for small instance it gives correct answer but when size of nodes increase let's say 16 then there are about 2000 binary variables and lpSolve

Re: [R] how to calculate seasonal mean for temperatures

2012-08-01 Thread arun
HI, Try this: #This might get you started: startdate - as.POSIXct(01/01/2006, format = %d/%m/%Y) enddate - as.POSIXct(01/12/2006, format = %d/%m/%Y)  date - seq(from = startdate, to = enddate, by = months,format = %d/%m/%Y)  DF -

[R] Can any one help me on this Issue

2012-08-01 Thread namit
Hi Friends, I'm new to R ,I have a data frame Z16 which is genarated from another data frame, and I want to add “%” “$” in row 4 and 5 respectively. when I’m trying using below logic, I’m getting warning message. I'm using R 2.14.2 Version Can anyone help me out on this. Note: Initially

[R] fit tevCopula using fitCopula in the copula package

2012-08-01 Thread wcurrent
Hi everyone I'm trying to estimate both the rho parameter and the degree of freedom of t-ev copula from the data using fitCopula function in the copula package. However, there is always an error and it says: Error: length(copula@parameters) == length(param) is not TRUE I also tried the same

[R] Error message: $ operator is invalid for atomic vectors

2012-08-01 Thread arun
HI, The code was working perfectly fine yesterday and today, until half an hour ago.  Couldn't find any problems in the code. Still, I am getting error message. myMatrix - data.matrix(read.table(text= Name    Age ANTONY    27 IMRAN  30 RAJ  22 NAHAS 

[R] Efficient deterministic algorithm for Matching Weighted Graphs with bounded degree.

2012-08-01 Thread khris
Hi Petr, The following is different line of thought which is posted in different form, maybe you have some wise input on it. I need to find Efficient(tracktable) deterministic algorithm for Matching Weighted Graphs with bounded degree. Now we all know Graph matching is non-tractable but when

[R] wgcna choice for softpower by scale indepence when combining to datasets

2012-08-01 Thread Ingezz
Dear Peter, I have another question about WGCNA. I am using the package for meta-analysis to find modules preserved in several datasets. However, I am unsure how to handle the softpower, because each dataset has its own ideal scale indepence value. When combining several datasets what should I

[R] splitting a vector

2012-08-01 Thread capy_bara
Hello, I have a vector with positive integer numbers, e.g. numbers - c(1,2,1,2,3,4,5) and want to split the vector whenever an element in the vector is smaller or equal to its predecessor. Hence I want to obtain two vectors: c(1,2) and c(1,2,3,4,5). I tried with which(), but it is not so

[R] Odd Results when using R's auto.arima function

2012-08-01 Thread PaulJr
Good morning everyone, I have attached an Excel file that contains a macro from which I call and use R's auto.arima function to generate forecasts. The program runs perfectly and it gets me the results; however, those results are pretty unusual. I also tried using the auto.arima function directly

[R] apply function over same column of all objects in a list

2012-08-01 Thread gail
Hello. Please forgive me if this problem has already been posted (and solved) by someone else ... I can't find it anywhere though it seems so very basic. Here it is: I have a list comprised of several matrices, each of which has two columns. list [[1]] [,1] [,2] [1,]1 3 [2,]

[R] Foreach help!

2012-08-01 Thread Cloneberry
Hi, just during these vacation days, I'm trying to approach with multicore package and I have some troubles with foreach. ex. foreach(.combine=c, ii=1:200, jj=1:500) %dopar% makefunction[ii,jj] Command seem to work but if I see ii and jj value at the and of cycle, they are both 200 instead than

Re: [R] Error message: $ operator is invalid for atomic vectors

2012-08-01 Thread arun
Hi Rui, Thanks.  It was my fault.  I had both of these saved (read.table (), data.frame(read.table()).  I think I accidentally pasted the second one, and got the error.  A.K. - Original Message - From: Rui Barradas ruipbarra...@sapo.pt To: arun smartpink...@yahoo.com Cc: r-help

[R] as.date: do not know how to convert 'test[1]' to class Date

2012-08-01 Thread algotr8der
I have an object, which I pull in from a csv file here http://r.789695.n4.nabble.com/file/n4638691/jan_2011.csv jan_2011.csv mydata - read.csv(jan_2011.csv, header=TRUE, sep=,) head(mydata) Delivery.Date Hour.Ending Repeated.Hour.Flag Settlement.Point Settlement.Point.Price 101/01/2011

Re: [R] how to calculate seasonal mean for temperatures

2012-08-01 Thread Ricardogg
You're totally right Jeff. My mistake! to use with, we write it like this: DF$season - factor ( with ( *DF*, ifelse (( month == 12 | nonth == 1 | month == 2 ), Win, ifelse ((month == 3 | nonth == 4 | month == 5 ) , Spr, ifelse

Re: [R] as.date: do not know how to convert 'mydata[1]' to class Date

2012-08-01 Thread Ricardogg
For me it owrks when i write it like: as.Date(paste(mydata$Delivery.Date), %m/%d/%Y) Hope it works, Regards, Ricardo -- View this message in context: http://r.789695.n4.nabble.com/as-date-do-not-know-how-to-convert-mydata-1-to-class-Date-tp4638691p4638696.html Sent from the R help mailing

Re: [R] apply function over same column of all objects in a list

2012-08-01 Thread gail
Thank you!!! But I realise I've simplified my data to the point that your solution doesn't actually work -- not your fault, mine! My list is actually more complicated than what I presented it to be; it's not composed of numerical matrices but of lists, each being composed of 7 columns, the first

Re: [R] Error in for-loop

2012-08-01 Thread Domi
Thank you for the answer, but I did´n find the solution. I'm a bit lost, cos I am a beginner in R. I hope you can give me a little bit more help. 2012/7/29 jholtman [via R] ml-node+s789695n4638270...@n4.nabble.com Try this: You had some 'indexing' problems. You were accessing the columns

Re: [R] Optimize a function with Discrete inputs

2012-08-01 Thread loyolite270
Thanks for the reply, but the example i have given above is a sample function. I would be using a function with input vector of size more than 100 and the function will compute some score based on the 100 vector combinations. Since i don't want to do this computation sequentially for all these

[R] R_nls_iter error: REAL() can only be applied to a 'numeric', not a 'logical'

2012-08-01 Thread matthewbk
Hi I am using the nls function in R however it is causing the following error: REAL() can only be applied to a 'numeric', not a 'logical' Using traceback shows this occurs after the .Call(R_nls_iter, m, ctrl, trace) call. However I do not know how to debug this further to find out what is

[R] add vectors to multiple objects

2012-08-01 Thread John linux-user
Hi everyone, I try to add many vectors (L1,L2,L3) to many list objects (a.list, b.list) in a workspace. Somethings like below, but it is not working. Any suggestions will be appreciated. Best, John lf=ls(pattern=.lst)  for (x in listfiles) {     dat=read.delim(x,header=F)     for

[R] sub setting a data frame with binomial responses

2012-08-01 Thread john.james
Hi everyone, Let me have a dataframe named “mydata” and created as below, * n=c(5,5,5,5) #number of trils x1=c(2,3,1,3) ) #number of successes x2=c(5,5,5,5) #number of successes x3=c(0,0,0,0) #number of successes x4=c(5,0,5,0) #number of successes mydata=data.frame(n,x1,x2,x3,x4) mydata*

[R] Changing labels positions in two graphics

2012-08-01 Thread gaiarrido
Hi, I´ve got some problems with the labels of the x-axis I,ve got two factors with two categories each: sex (males and females) and area (central and peninsulae), but because of the lenngth in the graphic just appeared two of the four labels. I thought the solution could be rotate it 45º

[R] plotting 0,1 data

2012-08-01 Thread Georgiana May
Hello, Anyone know why the command: plot(x,y) where y is a 0,1 result sometimes plots the y values as 1,2 rather than 0,1? And how to prevent this? Thank you, Georgiana May [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] assign vectors to objects

2012-08-01 Thread John linux-user
Hi everyone, I try to add many vectors (L1,L2,L3) to multiple list objects (a.list, b.list) in a workspace. Somethings like below, but it is not working. Any suggestions will be appreciated. Best, John lf=ls(pattern=.lst)  for (x in listfiles) {     dat=read.delim(x,header=F)    

[R] optimizing tune()/tune.nnet() for sensitivity or specificity

2012-08-01 Thread Grant Gordon
Hi - I'm using the tune.nnet() to identify the optimal tuning parameters for a dataset in which the dependent variables is binary and has very few 1s. As a result, tune.nnet() provides parameters that give high accuracy, but by increasing the specificity and decreasing the sensitivity radically.

Re: [R] as.date: do not know how to convert 'mydata[1]' to class Date

2012-08-01 Thread algotr8der
Thank you Ricardogg and Arun. I don't know how I missed that. Too many sleepless nights perhaps. Thank you. -- View this message in context: http://r.789695.n4.nabble.com/as-date-do-not-know-how-to-convert-mydata-1-to-class-Date-tp4638691p4638708.html Sent from the R help mailing list archive

  1   2   >