similar to: last 2 questions about save and load

Displaying 20 results from an estimated 70000 matches similar to: "last 2 questions about save and load"

2006 Jul 07
3
attach and detach question
I have a large R program that I am constantly running over and over again. At the beginning of this program, I create a hige matrix and a huge dataframe but these are constant. What I mean by constant is that, if I run the program over later, I really should just use the old matrix and dataframe ( if they exist ) that were created in a previous run so that the program doesn't have to spend
2009 Aug 05
4
A question regarding R scoping
I have a question related to scoping. Suppose we have 2 functions: f1 = function(i){i = 1} f2 = function(n){ i = length(n) f1(i) } In other words, I would like i=1 regardless of n. Is this possible without having f1 in the body of f2? Thanks in advance!
2009 Mar 31
1
error when going through Alan Lenarcic's package Tutorial
Hi Everyone: I've been going through Alan Lenarcic's package tutorial but when I did R CMD SHLIB Xdemo.cc Xdemo_main.cc -o Xdemo.dll I got the following error: XDemo_res.rc:15:38: warning: missing terminating " character XDemo_res.rc:23:34: warning: missing terminating ' character c:\mark\research\Rtools\MinGW\bin\windres.exe: XDemo_res.rc:16: syntax error
2008 Sep 23
4
perl expression question
If I have the string below. does someone know a regular expression to just get the "BLC.NYSE". I bought the O'Reilley book and read it when I can and I study the solutions on the list but I'm still not self sufficient with these things. Thanks. stock<-"/opt/limsrv/mark/research/equity/projects/testDL/stock_data/fhdb/US/BLC.NYSE"
2009 Nov 13
4
processing log file
Dear all, I'm trying to process a log file which logs the date, the username and the computer number accessed. The table looks like this: >table.users          Date UserName Machine 1  2008-11-25     John     641 2  2008-11-25    Clive     611 3  2008-11-25   Jeremy     641 4  2008-11-25     Walt     722 5  2008-11-25     Tony     645 6  2008-11-26     Tony     645 7  2008-11-26    
2006 Jun 28
2
hopefully my last question on lapply
Marc and many other people ( whose names escape me ) have been very helpful in explaining the use of lapply to me. In his last response, Marc explained that if tradevectors is a list of vectors of different lengths ( excuse my terminology ) then lapply(tradevectors,function(x) G[x]*B[x] ) will go through each component of the list as if it was a vector and apply the element by element
2006 Jun 16
2
scatterplot but a little tricky
i have two vectors of numbers x and y and of course i can do the standard scatterplot plot(x,y) and it looks fine. But, I was hoping there was a way to do the scatterplot so that each point plotted is a number where the number represents the index in the dataset. so, if it was x[3] and y[3], then the point would be a 3 or if it was x[4] and y[4], then the point would be a 4 etc. i doubt this is
2006 Jul 05
2
apologes if you already saw this :efficiency question
hi everyone : i'm not sure if my previous mail about this got sent. i was typing and erroneosuyl hit a button and lost what i was typing. anyway, i have the code below ( it works ) in which i run through the rows of a dataframe, taking out the first two fields which are characters strings ( with some extra spacing so i yuse gsub) and appending these character strings to a list so that i can
2007 Nov 16
4
alternative to logistic regression
You can fit a linear probability model with glm and a bit of arm twisting. First, make your own copy of the binomial function: > dump('binomial', file='mybinom.R') Edit it to change the function name to "mybinom" (or anything else you like), and to add 'identity' to the list of okLinks. Source the file back in, and use mybiom('identity') to fit
2006 Jul 06
2
[Fwd: as.data.frame question]
>From: markleeds at verizon.net >Date: Thu Jul 06 13:16:42 CDT 2006 >To: markleeds at verizon.net >Subject: as.data.frame question >hi all : as a result of an lapply command, >i get the following output. > > >$AAA > 000106 000107 000108 > 5.5 6.5 3.0 > >$BBB > 000106 000107 000108 > 4 5 6 > >$CCC
2009 Jun 01
1
Fwd: subset dataframe/list
--- the forwarded message follows --- -------------- next part -------------- An embedded message was scrubbed... From: "Cecilia Carmo" <cecilia.carmo at ua.pt> Subject: Re: [R] subset dataframe/list Date: Mon, 01 Jun 2009 21:33:15 +0100 Size: 3657 URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090601/921f7638/attachment-0002.mht>
2006 Jun 04
2
difference in behavior between batch and source
Hi : I am using R 2.20 on windows XP and I have a REALLY long read.table statement because the col.names argument has 440 character strings in it. ( I use python to write R code ). When I run the read.table statement inside an R program ( the R program only consists of the read.table statement ) using the source command in an interactive R session, everything works fine. But, if I take the same
2008 Jul 05
3
trying to superimpose a line plot onto a histogram
Hello, I'm trying to superimpose a line plot onto a histogram but I'm not having any luck. I've attached the dataset. What I did was: > hist(data,freq=F) Now I'm trying to superimpose the following points with a line connecting them onto the histogram: x y 100 0.535665393824959 200 0.212744329736556 300 0.0844933242968584 400 0.0335572838043417 500
2009 Apr 01
1
problems with package tutorial
Hi: Here's my revised attempt at explaining my problem. Hopefully it won't get sent out weirdly like it did earlier. ? The link to what I'm trying to follow is http://www.stat.columbia.edu/~gelman/stuff_for_blog/AlanRPackageTutorial.pdf ? I've been going through the tutorial but when I got to page 9 and did R CMD SHLIB Xdemo.cc Xdemo_main.cc -o Xdemo.dll I got
2009 Feb 05
4
eval and as.name
I'm sure there is a more general way to ask this question but how do you use the elements of a character vector as names of objects in an expression? For example, say you have: a = c(1,3,5,7) b = c(2,4,6,8) n=c("a","b") and you want to use the names a and b in a function (e.g. sum) sum(eval(as.name(n[1])),eval(as.name(n[2]))) works but what is a simpler way to
2009 Feb 11
2
error in my previous message
i'm sorry. i had an error in my previous code because i left out a letter in the rownames. while fixing that, i also found a solution. so i'm sorry for the confusion. below is my fix. temp2 <- matrix(rnorm(10),nc=1,nrow=10) rownames(temp2) <-
2008 Jul 14
3
statistics question about a statement in julian faraway's "extending the linear model with R" text
In Julian Faraway's text on pgs 117-119, he gives a very nice, pretty simple description of how a glm can be thought of as linear model with non constant variance. I just didn't understand one of his statements on the top of 118. To quote : "We can use a similar idea to fit a GLM. Roughly speaking, we want to regress g(y) on X with weights inversely proportional to var(g(y).
2009 Jun 10
3
package installation fails (RandomFields)
I have been unable to install the package RandomFields. I am using R 2.9.0-4 on Ubuntu 9.04. To install, I use the command: sudo R CMD INSTALL RandomFields_1.3.37.tar.gz The output follows below. Any help Would be appreciated. D. Hoysak Brandon University * Installing to library ?/usr/local/lib/R/site-library? * Installing *source* package ?RandomFields? ... ** libs g++
2009 Jun 10
3
package installation fails (RandomFields)
I have been unable to install the package RandomFields. I am using R 2.9.0-4 on Ubuntu 9.04. To install, I use the command: sudo R CMD INSTALL RandomFields_1.3.37.tar.gz The output follows below. Any help Would be appreciated. D. Hoysak Brandon University * Installing to library ?/usr/local/lib/R/site-library? * Installing *source* package ?RandomFields? ... ** libs g++
2006 Jun 20
2
strange use of sapply
I've tried and give up. I have a matrix of say 200 columns and 400 rows. For each odd ( or even i suppose if i wanted to )column, I want to know the number of rows in which the value is greater than zero. So, I did sapply(tempMatrix,2,function(x) sum( x > 0 )) this almost works but i don't know how to tell it to only do the odd columns. my guess is , like everything else in R, this