[R] Help needed in reading matlab files

2012-08-14 Thread jerome
Dear users, I am stucked with a programming problem: I am trying to download a squared adjacency matrix from matlab with only 0 or 1. Doing it without a loop at first, I get an error message that is, I think, related to the "mat_adj<-readMat(pathnames_adj)" line. Did anybodz encouter already

[R] confint function in MASS package for logistic regression analysis

2012-01-18 Thread Jerome Myers
ion. Or perhaps I misunderstand the application of the confint fuuction in the MASS package. If someone knows the explanation, I'd appreciate it. -- Jerome L. Myers [[alternative HTML version deleted]] __ R-help@r-project.org mailin

[R] Monte Carlo Random Walk

2011-10-18 Thread jerome
Hello all, I am quite new to R, with the goal of using it for a project in my business course. I am attempt to run a Monte Carlo simulation of futures prices based on a random walk whereby the given volatility (I will use historical volatility in this case, say 12%) is Levy-distributed , equally

Re: [R] Using a sting in variable names

2011-05-16 Thread Jerome Asselin
aste() to form the strings and assign() to save your objects? > for(i in 1:100) assign(paste("vpn", i, sep=""), read.table(paste("vpn", i, ".dat"))) HTH, Jerome [[alternative HTML version deleted]] _

Re: [R] File to MYSQL

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 17:01 -0300, Nilza BARROS wrote: > Hi, Jerome > > I was trying to use RMYSQL > > for (i in length(Query)) { > rs1<-dbSendQuery(con,Query[i]) > } > > But although the Query have several lines the command above just feed > my database

Re: [R] File to MYSQL

2011-05-16 Thread Jerome Asselin
INTO OBS > (date,T_2M,TMAX_2M,TMIN_2M,TD_2M,PS,FF_10M,DD_10M,TOT_PRCP,CLCL' at line 1 > > > "INSERT INTO OBS (date,TMAX_2M,TMIN_2M,TD_2M,PS,Station_NO) VALUES > (2011051312, NULL, 20.6,19.4,1014.8,836490)" > "INSERT INTO OBS (date,TMAX_2M,TMIN_2M,TD_2

Re: [R] reading multiple .dbf files

2011-05-16 Thread Jerome Asselin
ot;package:foreign")(dbf.name) : > unable to open DBF file > > How can I read these files at once? What is the value of x after you get the error? x should be a file name. Is it really a valid DBF file? Jerome [[alternative HTML version deleted]]

Re: [R] Scale time series in a way that 90% of the data is in the -0.-9/ +0.9 range

2011-05-12 Thread Jerome Asselin
ted. For example, it will not work as expected if your data is generated with: y <- rexp(N) HTH, Jerome __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/

Re: [R] Regexp question

2011-05-04 Thread Jerome Asselin
On Wed, 2011-05-04 at 22:41 +0300, johannes rara wrote: > I have a string like this > > st <- "SELECT COUNT(empid), COUNT(mgrid), COUNT(empname), > COUNT(salary), FROM Employees" > > How can I remove the last comma before the FROM statement? gsub(",[^,

Re: [R] Controlling the extent of ablines on plot

2011-05-03 Thread Jerome Asselin
On Tue, 2011-05-03 at 10:36 -0600, Ryan Utz wrote: > Hi all, > > I'm attempting to make a quite-specific plot where the axes cross at the > origin and with gridlines for guidance. I've been using ablines to create > the reference lines because I want a lot of control as to where they are > placed

Re: [R] List of Data Frames

2011-05-02 Thread Jerome Asselin
t statistics. My understanding is that you want to have one data frame per week. I question whether it is necessary to split these data frames. I would design a single data frame with one column to identify the week and then work on subsets of that data frame to calculat

Re: [R] How to define specially nested functions

2011-04-28 Thread Jerome Asselin
his yields. > f(3, 2, z) function (z = "z") 3 + 2 + (3^2 - z) > f(3, 2, z)(3) [1] 11 I haven't figured out how to get rid of the default argument value shown here as 'z = "z"'. That doesn't prevent it to work, but it's less pretty. If you fin

Re: [R] Normality tests

2011-04-26 Thread Jerome Asselin
elves? As seen below, the shapiro.test() output is a list of four components. > names(shapiro.test(rnorm(100, mean = 5, sd = 3))) [1] "statistic" "p.value" "method""data.name" You can extract just the p-value with: > shapir

Re: [R] separate and arrange outputs

2011-04-26 Thread Jerome Asselin
class for your object and then write a "print" method. Example: a <- list(a=2, b=c(2,2,2)) class(a) <- "myclass" print.myclass <- function(x) { print(x[[1]]) cat("***\n") print(x[[2]]) } This yields: > a [1] 2 *** [1] 2 2 2 HTH,

Re: [R] About How to check if a html directory exists

2011-04-25 Thread Jerome Asselin
.file() error and, if there is one, handle it accordingly. See help(try) Regards, Jerome __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] filling array with functions

2011-04-22 Thread Jerome Asselin
On Fri, 2011-04-22 at 10:02 -0700, derek wrote: > Hello R, > > I would like to find out how to generate array full of functions. I tried it > like this: > > fv=array(,dim=c(1,10)) > V=c(1:10) > for (i in 1:10){ > fv[i]<-function(x)(V[i]-b*a*x) # b, x are constants. > } > > But it returns: > "inc

[R] hdf5 library install issue

2011-02-18 Thread Jerome
Dear all I'm trying to install the hdf5 library into R. The HDF5 package is installed in a special directory, distributed accross my cluster: /share/apps/HDF5 So i put the args option to the configure command as i read in previous post in the list: jerome]# R CMD INSTALL --configure

[R] repeated measures with a group factor

2010-08-02 Thread Jerome L. Myers
rning message: In Anova.mlm(model.lm, idata = Bdf, idesign = B, Type = "III") : the model contains only an intercept: equivalent Type III test substituted" I've tried variations of the lm parameters (e.g., ~1 inserted) but it still yields an error message. I'd appreciate s

Re: [R] Non linear programming optimization (which package to use?)

2009-11-12 Thread Jerome Chong
optimization purpose? If so, how? > Example: > Fitted to: revenue = -700price^2 + 5200price + 780 > Subject to: price range between 10 to 50 > > Thanks, > Jerome > > You are confused. That is not an nonlinear progr

[R] Non linear programming optimization (which package to use?)

2009-11-11 Thread Jerome Chong
range between 10 to 50 Thanks, Jerome __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained