>If you have a version of Excel that will do all those things, then you
>should be able to write a very short VBA macro that will do it.
>Undoubtedly simpler than the route you are proposing.
Thanks for reply David, i was thinking about going this route, the problem
is i will have to do it o
Mike Williamson gmail.com> writes:
> I have a (relatively long) function script that generates a levelplot.
> I don't want to include all of the code, so I have attached in file
> "miniDataSet.csv" an example for the data set "miniDataSet" that is called
> below.
Thanks for providing a full
On 8/04/2009, at 2:31 PM, Roslina Zakaria wrote:
Hi Rolf,
I would like to extend the problem that I asked you before
regarding the newton method using 4 functions with 4 parameters.
My functions involve the modified bessel function of the first kind
which I can type them without any pr
Dear R users:
I try to model-based recursive partition a dataset (~3,500 records) using the
mob function from the party package (many thanks to Achim Zeileis, Torsten
Hothorn, Kurt Hornik and all other contributors for this wonderful tool). In
this dataset, I have two related categorical varia
Thanks for the help everyone! I'm new to vectors, and don't quite get it.
This works for me:
binary.vars <- c("q1", "q2", "q3", ...)
apply(mydata[binary.vars], 2, tapply, mydata["male"], mean)
but this doesn't:
other.vars <- c("male", "race", "religion")
apply(mydata[other.binary.vars], 2, ta
Hi,
I do not know what your problem is, but it seems like you want to solve a
system of non-linear equations.
Look at the function dfsane() in the package "BB". It doesn't require you to
specify jacobians.
require(BB)
?dfsane
Ravi.
___
Hi Rolf,
I would like to extend the problem that I asked you before regarding the newton
method using 4 functions with 4 parameters. My functions involve the modified
bessel function of the first kind which I can type them without any problem.
The big problem is the Jacobian matrix.
I use Mapl
On Tue, 7 Apr 2009, Yuri Volchik wrote:
Hi,
i'm trying to read some data from excel files but it seems that neither
xlsReadWrite nor sqlFetch (RODBC) doesn't like the format (Excel 5.0).
When i open the file in Excel and save it in a new format Excel 97 -2003
everything works fine.
Is it possi
Kamalic Dan wrote:
Hello R-help list,
I have a piece of code written by a grad student here at BU which will segfault
when using one data set, but complete just fine using another. Both sets are
just text files full of real numbers.
It seems like a bug within R. It could be a bug within he
Hello,
Is there any binary version of R 2.8.x available for x86 Solaris 10? I need it
so that I can use some R library files. I actually tried to compile the source
myself, but it failed. I don't know much about how to compile source files on
Solaris, and it will be great if there is a bin
On 8/04/2009, at 1:27 PM, Ben Bolker wrote:
I agree that that the individual-level random effect is probably
the issue.
I played with this some today but didn't manage to resolve it --
tried JAGS/R2jags and glmer from lme4 but didn't manage to
get an estimate of epsilon that matched
Rolf Turner-3 wrote:
>
>
> On 8/04/2009, at 1:26 AM, jjh21 wrote:
>
>>
>> Hello,
>>
>> I am trying to simulate binary outcome data for a logistic
>> regression Monte
>> Carlo study. I need to eventually be able to manipulate the
>> structure of the
>> error term to give groups of observat
Hi R-experts,
I'm using the svm implentation available in the library 'e1071',
to train a classifier using cross validation
(...)
obj = tune.svm(truth ~ .,
data=examples,cost=2^(grid.cost),gamma=2^(grid.gamma),cross=k)
and to save the best model into a file as ?write.svm suggests:
write.svm
R'ers:
I was hoping I could get some direction on this. I have a dataset
of the form:
Y1,Y2,...,YM = f(X1,X2,...,XN), where N is >>> M
The response data (Y1,Y2,...,YM) is frequency data, such that the sum of
all Yi = 1.0. Both Xj and Yi are continuous variables.
I'm trying to figure o
Hi list!
Short version: How do I convert a whole data.frame from latin1
encoding to utf8?
I get SPSS files with latin1 encoding. My OS is GNU/Linux and the
locale sv_SE.utf8, and I normally interface R with Emacs/ESS. I have
used the following hack to convert a data.frame in latin1 to utf8:
> Sy
On Tue, 2009-04-07 at 05:16 -0700, Melissa2k9 wrote:
> Hi,
>
> I am trying to make a sequence and am using a for loop for this. I want to
> start off with an initial value ie S[0]=0 then use the loop to create other
> values. This is what I have so far but I just keep getting error messages.
>
>
Gene,
I agree that by using "nls" you are able to also enforce box-constraints on
the betas. There is one more issue. My trick doesn't really force the sum
to be 1. It is very close, but not exactly so. You can use "weights" to
achieve this. Here you go:
# analysis without "weights"
ans2 <-
On Tue, Apr 7, 2009 at 4:41 PM, Jorge Ivan Velez
wrote:
> Hi Eik,
> You're absolutely right. My bad.
>
> Here is the correction of the code I sent:
>
> apply(mydata[,-1], 2, tapply, mydata[,1], function(x) sum(x)/length(x))
Or more simply:
apply(mydata[,-1], 2, tapply, mydata[,1], mean)
Hadley
Kia ora Juan
?merge
HTH
Peter Alspach
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Juan Pablo Fededa
> Sent: Wednesday, 8 April 2009 8:55 a.m.
> To: r-help@r-project.org
> Subject: [R] matrix filtering and reorderi
Josh, I would recommend to use a package that supports networks, e.g.
igraph, but there are others as well.
You can read in the data using 'read.csv()', transform it to a matrix
with 'as.matrix()', and then create an igraph object from it with
'graph.adjacency()'.
Then call 'minimum.spanning.tree
There was an error in the file... an extraneous comma. That's taken care of.
however, my tree prints out an image that doesn't seem like a mst. Attached
is the csv file I used...
http://www.nabble.com/file/p22938299/sp_matrix.csv sp_matrix.csv
I'd like it to look something like the image fil
I have two matrixes,
red:
a 123
c 200
d 400
e 650
g 127
f 100
and blue:
a 10
b 20
c 30
d 40
e 50
f 60
g 70
is there any easy way to get the next matrix:
a 10 123
b 20 0
c 30 200
d 40 400
e 50 650
f 60 100
g 70 127
i.e. to add in the third column of blue the [,2] values of red corresponding
t
Apologies, it was as.formula(),
I have since found out that if you pass to cast() the formula as a
character string "days ~ variable" it works.
Gavin Simpson
04/07/09 03:40 PM
Please respond to
gavin.simp...@ucl.ac.uk
To
ryan.shef...@malbecpartners.com
cc
r-help@r-project.org
Subject
Re:
Hi Eik,
You're absolutely right. My bad.
Here is the correction of the code I sent:
apply(mydata[,-1], 2, tapply, mydata[,1], function(x) sum(x)/length(x))
Thanks for pointed this out.
Best regards,
Jorge
On Tue, Apr 7, 2009 at 5:29 PM, Eik Vettorazzi <
e.vettora...@uke.uni-hamburg.de> wro
Very nice trick!!! Thank you!
When you combine your trick with the "nls" function, you get the whole
thing:
#(I have also simplified the model since the first post)
###
#Original Method: uses optim, but doesn't create "model":
###
You could use rep() to turn your frequency table
into a raw data vector and then call hist, which retabulates
the raw data and plots the table with barplot. That is
useful if you want a histogram on a courser scale than your original
table. (S+'s hist() function has a freq= argument so
that hist(
Hi,
Id appreciate your thoughts regarding the following. Im working with an
insurance data set with the objective of predicting a binary outcome (claim
or not). Policyholders in the sample are not observed for equivalent time
periods. I have an exposure variable that reflects the amount of tim
Hi Jorge,
> apply(mydata[,-1], 2, tapply, mydata[,1], function(x)
sum(x)/nrow(mydata))
will calculate the total percentages of "yes" for each sex relative to
the total size, not within sex.
with your data construction, the following should work
#count "yes" for each sex and question
cnts<-agg
Arghh! How stupid can you (I) be. It is R.exe that is called and not
RCMD.exe. Hence the program is waiting for a response to the question
about saving the workspace.
Tom
Tom Backer Johnsen wrote:
Gentlepersons:
A long time ago I used to be able to start R (version 2.6.1) from a
Delphi 7
On Tue, Apr 7, 2009 at 10:46 PM, Surendar Swaminathan
wrote:
> Hello Gabor,
>
> Thank you very much for the reply.With respect to the cross post.I
> replied to the thread that was created I must have made a mistake.
And replied alternately to r-help and igraph-help.
> I tried
> working on the
Hi All,
I have a panel xyplot with 2 lines in each panel. I'd like to label one line
only but don't know how to do this. The code below labels both lines. Any
ideas how I could change it to show the y-values of only one of the lines?
Many thanks!
xyplot(apples + bananas ~ year | category, data=fr
On 8/04/2009, at 1:26 AM, jjh21 wrote:
Hello,
I am trying to simulate binary outcome data for a logistic
regression Monte
Carlo study. I need to eventually be able to manipulate the
structure of the
error term to give groups of observations a random effect. Right
now I am
just doing a v
sorry, typo
(diff.w<-(as.numeric(dates-st.date)+1)%/%7)
should have been
(diff.w<-as.numeric(dates-st.date)%/%7)
Marco Helbich schrieb:
Hello Eik,
sorry that I contact you again, but I have still a problem with my
dates. I need a numeric starting point begining at 01-08-2005
(DDMM) f
Dear Donald,
Assuming that your data is called "mydata", the first column represents the
gender and the questions are the columns left, something like the following
should do the job:
# Some data
set.seed(1)
mydata <- matrix(rbinom(1000,1,p=0.5),ncol=10)
colnames(mydata)<-c('sex',paste('q',1:9,sep
ok, here we go
#starting date
st.date<-as.Date("01-08-2005","%d-%m-%Y")
#your dates converted into Date data type
dates<-as.Date(date,"%d-%m-%Y")
#diff from st.date in days
(diff.d<-dates-st.date)
#diff in weeks
(diff.w<-(as.numeric(dates-st.date)+1)%/%7)
#or use explicitly built in function dif
Hello Gabor,
Thank you very much for the reply.With respect to the cross post.I
replied to the thread that was created I must have made a mistake.I tried
working on the code. I have total of 5 different graphs and Bonpow function
in Igraph works for 2 graphs and for the other it goes out of mem
Nathan,
please do not crosspost, it is actually lowers your chances to get a
reply. Thanks.
On Tue, Apr 7, 2009 at 10:20 PM, Surendar Swaminathan
wrote:
> Hello Gabor,
>
> Thank you very much for the reply.I tried working on the code. I have
> total of 5 different graphs and Bonpow function in
a1 <- "qss(x1,lambda=100)"
> parse(text=a1)[[1]][[2]]
x1
This will not work for length(a) != 1, so you have to explicitly map
over your list, e.g.
a <- paste("qss(",paste("x",1:6,sep = "") ,", lambda =100)", sep = "")
> dput( lapply(a,function(x)parse(text=x)[[1]][[2]]) )
list(x1, x2, x3, x4, x5,
I don't think I'm mixing up [[ and [. Perhaps my explanation wasn't
perfect, but I was in fact trying to show the same differences you are
showing.
-s
On Tue, Apr 7, 2009 at 2:01 PM, Bert Gunter wrote:
> Aren't you mixing up [[ and [ ?
>
>> x <- 1:3
>> x[0]
> integer(0)
>> x[[0]]
I've been playing around with various table tools, trying to construct a
fairly simple cross-tab. It shouldn't be hard, but for some reason it
turning out to be (for me).
If I want to see how many men and how many women agree with a agree/disagree
question (coded 1,0), I can do this:
>attach(myd
Hi all, I'm very new to R and read a few tutorials, however I'm having
difficulty trying to figure out how to plot a minimum spanning tree. I have
a csv file that contains an n-by-n matrix of distances between strains of
bacteria called matrix.csv.
Looks like:
id,strain1, strain2,strain3
strain1
Dear Hans,
Try also:
x <- structure(c(2, 1, 2, 1, 3, 2, 4, 1, 4, 3, 4, 3, 5, 2, 5, 1, 6, 1), .Dim
= c(2L, 9L))
tapply(x[2,],x[1,],sum)
#2 3 4 5 6
#2 2 7 3 1
HTH,
Jorge
On Tue, Apr 7, 2009 at 11:06 AM, Hans-Henning Gabriel <
hanshenning.gabr...@gmail.com> wrote:
> Hi,
>
> my problem is as foll
Josh, please stay on the list. Thanks. Answers below.
On Tue, Apr 7, 2009 at 10:15 PM, Josh Earl wrote:
>
>
> Gabor,
>
> Thanks so much for your quick reply! I think this will do exactly what I'm
> after. I'm getting a couple errors though, one is (if I do)
> D<-D[,-1]
> I get the error:
> Erro
Hello Gabor,
Thank you very much for the reply.I tried working on the code. I have
total of 5 different graphs and Bonpow function in Igraph works for 2 graphs
and for the other it goes out of memory.It is the same case using sparse
matrix. The graphs that did not work for Bonpow function in Igr
I'm creating an ANOVA model. Is there a way to pull in consecutive columns of
variables for the test?
Example: aov1<-aov(y~x1+x2+REG[,2:num], data=REG)
I'm not looking for interaction effects, I just want to create a model for the
first few columns of variables (exact number and names will var
Hi Weicheng,
Did you forget to add " " to index your elements? The following example
works perfectly fine.
test.matrix = matrix(1:4,nrow=2) ;
rownames(test.matrix)=c("hi1","hi2") ;
colnames(test.matrix)=c("bye1","bye2") ;
test.matrix
bye1 bye2
hi113
hi224
test.matrix["hi1"
One simple explanation for the error message you received is that you have a
typo: 'lapply' instead of 'apply':
x <- matrix(1:6, 2)
apply(x, 1, sum)
[1] 9 12
lapply(x, 1, sum)
Error in match.fun(FUN) : '1' is not a function, character or symbol
However, it's difficult to diagnose withou
On Tue, 2009-04-07 at 09:47 -0400, ryan.shef...@malbecpartners.com
wrote:
> I am trying to use the "cast" function from the reshape package, where the
> formula is not passed in directly, but as the result of the as.formula()
> function.
>
> Using reshape v. 0.7.2
>
> I am able to properly me
one way seems to be the following:
a <- paste("qss(",paste("x",1:6,sep = "") ,", lambda =100)", sep = "")
all.vars(parse(text = a))
I hope it helps.
Best,
Dimitris
roger koenker wrote:
I have a vector of character strings that look like R expressions:
> a <- paste("qss(",paste("x",1:6,sep
unlist(lapply(parse(text=a), function(x) deparse(x[[2]])))
seems to do the job.
Patrick Burns
patr...@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")
roger koenker wrote:
I have a vector of character strings that lo
Hi, I want to use the value of variable to quote elements in matrix.
For example, I have a matrix like:
y1 y2m1 1 2m2 3 4
where y1,y2,m1,m2 are column and row names. I have two random character
variable, say x, that could be either y1 or y2 and y that
I have a vector of character strings that look like R expressions:
> a <- paste("qss(",paste("x",1:6,sep = "") ,", lambda =100)", sep =
"")
> a
[1] "qss(x1, lambda =100)" "qss(x2, lambda =100)" "qss(x3, lambda =100)"
[4] "qss(x4, lambda =100)" "qss(x5, lambda =100)" "qss(x6, lambda =100)"
Tha
Hi All,
I have a panel xyplot with 2 lines in each panel. I'd like to label one line
only but don't know how to do this. The code below labels both lines. Any
ideas on how I could change it to show the y-values of only one of the
lines? Many thanks!
xyplot(apples + bananas ~ year | category, dat
Hi everyone,
I try to make a netcdf file which disposes a difference between 2 variables
of 2netcdf files same dimension
When I programmed under R, everything is ok but when I put the code under
EOF of a sh script, an error occurs:
"Error, passed variable has a dim that is NOT of class dim.ncdf!".
Hello,
I am working on a Tobit Model for a consumer good, left censored with zero.
Relation: Sales of product depend on price, promotion (dummy), Season(dummy)
and store (dummy)
Used standard Tobitmodel with package(AER) vor a 48 week period:
tobitmodel<-tobit(SALE~Price+Promotion+Season+Stor
Aren't you mixing up [[ and [ ?
> x <- 1:3
> x[0]
integer(0)
> x[[0]]
Error in x[[0]] : attempt to select less than one element
> x[4]
[1] NA
> x[[4]]
Error in x[[4]] : subscript out of bounds
The docs say:
"The default methods work somewhat differently for atomic vectors,
matrices/arrays and f
Hi All,
I have a panel xyplot with 2 lines in each panel. I'd like to label one line
only but don't know how to do this. The code below labels both lines. Any
ideas how I could change it to show the y-values of only one of the lines?
Many thanks!
xyplot(apples + bananas ~ year | category, data=fr
Another possibility is to transpose and use functions that assume the grouping
is by rows, such as summaryBy in the doBy library. If you can easily work with
your data this way, the code might be more clear.
> library ( doBy )
> databyrows <- rbind ( c ( 2, 2, 3, 4, 4, 4, 5, 5, 6), c(1, 1, 2
After some headscratching I found the solution. Perhaps the options for
calling R has been changed. Place " CMD BATCH --no-save --silent "
between the call on R and the naming of the files for input and output.
Tom
Tom Backer Johnsen wrote:
Gentlepersons:
A long time ago I used to be able
Thank you Professor Brian Ripley for very helpful comments.
Using type="tiff24nc" in bitmap mostly solved my problems. However, some
complicated figures still come out in greyscale with bitmap even when
using type="tiff24nc". The tiff function preserves the color but reduces
the character size as
Hi Gene,
Try the following approach using lm():
set.seed(121)
x1=.04
for (i in 1:14) x1[i+1]=x1[i]*(1+rnorm(1)*.008)+.00025
x2=.08
for (i in 1:14) x2[i+1]=x2[i]*(1+rnorm(1)*.03)-.0018
x3=.01
for (i in 1:14) x3[i+1]=x3[i]*(1+rnorm(1)*.15)-.0008
b=matrix(c(0.6,0.0,0.4)) # why don't you assume a v
Giam Xingli nus.edu.sg> writes:
> I need the studentized residuals. In linear models, they can be computed by
using rstudent( ) function, but
> there seems to be no such function for nls( ) output.
I darkly remember having read this message before. Homework still not done?
http://markmail.org/m
Mark Heckmann gmx.de> writes:
> I am trying to create a graphic output in Sweave but I do not want it to be
> standard size. I want the whole graphic to be 80mm of height only, just like
> the viewport below.
>
> <>=
>pushViewport(viewport(height = unit(80, "mm")))
>grid.rect()
>
On 4/7/2009 10:39 AM, Mark Heckmann wrote:
I am trying to create a graphic output in Sweave but I do not want it to be
standard size. I want the whole graphic to be 80mm of height only, just like
the viewport below.
<>=
pushViewport(viewport(height = unit(80, "mm")))
grid.rect()
gr
Dear R-helpers:
I am trying to use aalen{timereg} to run a model and found that it generates
the following message.
the data set I used is
> dim(indf)
[1] 1374310
#R code:
fit_aalen <- aalen(Surv(durdxdeathp, die) ~ 1+factor(gender), indf)
#start of error message below
Non unique survival tim
I am trying to confirm that the sample is not different from the population
with respect to geographical respresentation for the following data:
region population sample n_total s_total
1 north 124423290771032
2 south 4333
Hi ya'll,
thanks for pointing out the obvious ;-)
I didn't think of that (and I showed it to a fellow colleague who
didn't spot it either, I am going to blame her for that).
Best,
Stefan
On Tue, Apr 7, 2009 at 4:52 PM, Karl Ove Hufthammer
wrote:
> stefan.d...@gmail.com:
>
>> I came across a
Thanks James. That worked.
Tanuja
--- On Tue, 4/7/09, James W. MacDonald wrote:
From: James W. MacDonald
Subject: Re: [R] heatmap.2 no reordering of the columns and rows
To: "Tanuja Bompada"
Cc: r-help@r-project.org
Date: Tuesday, April 7, 2009, 8:02 AM
Hi Tanuja,
Tanuja Bompada wrote:
> Hi
Not sure what you're trying to accomplish, but I think the index values are
off. the first element of s is 1, not 0
Here's something that works:
s<-rep(0,207)
s<-as.vector(s)
s[0]<-0
lambs=rep(rnorm(207)*1000)
for (i in 1:(length(lambs)-1)){
s[i]<-s[i+1]-mean(lambs)
}
On Tue, Apr 7, 20
I'm plotting the following (stripped of inessentials)
xyplot(sd ~ distance | wshed,data=sdvar.df,scales=list(x=list
(log=TRUE),y=list(log=TRUE)))
sdvar.df is a data frame, sd and distance are numeric, wshed is an
ordered factor
trying to replicate the action of log="xy" in plot()
The pl
Hello all, I have an optimization routine that is giving me good results,
but the results are not in the nice "model" format like "lm". How can I get
optim results into a model so that I can use the clever 'fitted',
'residuals', and 'summary' functions?
Using optim is the only way that I was able
On Tue, Apr 7, 2009 at 8:13 AM, Melissa2k9 wrote:
>
> I am trying to make a sequence and am using a for loop for this. I want to
> start off with an initial value ie S[0]=0 then use the loop to create other
> values. This is what I have so far but I just keep getting error messages.
>
R only all
Dear plm Package users,
I use the plm package a lot but I have not updated it for some times.
Now I realized the following difficulty with the summary.plm function
(demonstrated with the example from the ?plm documentation).
library(plm)
data("Produc", package="Ecdat")
estimation_meth
Hello R-help list,
I have a piece of code written by a grad student here at BU which will segfault
when using one data set, but complete just fine using another. Both sets are
just text files full of real numbers.
It seems like a bug within R. It could be a bug within her data, but
again, he
Hi Melissa,
first of all in R indexes of vectors starts with 1 not with 0. So
s[0]<-0 doesn't make sense here (minor second point R is also case
sensitive, so S[] is not the same as s[]).
Secondly rep() returns already a vector, so as.vector(s) is not necessary.
Thirdly, loops are "bad" under p
Hi all,
I'm looking for zip code shapefiles for Italy and France.Does anyone know
where I might be able to find these?
thank you!
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo
see ?aggregate
m<-rbind(sample(2:6,9,replace=T),sample(1:3,9,replace=T))
aggregate(m[2,],by=list(m[1,]),sum)
Hans-Henning Gabriel schrieb:
Hi,
my problem is as follows:
I have a matrix of two rows like this:
2 2 3 4 4 4 5 5 6
1 1 2 1 3 3 2 1 1
Can I apply something like "group by" in sql? W
Think about what i-1 would be the first time though the loop. R
doesn't like 0 as an index. You are going to need to decide what you
consider to the the "previous value" for the first element in your
vector.
If you want cumulative sums, then look at the function cumsum
?cumsum
On Apr 7, 2
On 4/7/2009 10:31 AM, Yuri Volchik wrote:
Hi,
i was wondering if there is a way to annotate rgl plot, after searching i
haven't found anything suitable. I saw function text3d but was thinking more
about text on the margin, so not interactive.
rgl currently only sets up one coordinate system, s
Hi Henning,
Although there might be a better way to do this, I'd suggest (with
my.matrix being the matrix you provided):
complete.vector = rep(my.matrix[1,],my.matrix[2,]) ;
table(complete.vector) ;
Is this what you're looking for?
Cheers,
Luc
Hans-Henning Gabriel wrote:
Hi,
my problem i
It would indeed be cool to have R be able to call .NET code given all the
functionality one can use with the latest version of the .NET framework. I
actually make use of the MATLAB/.NET interface, and I find it quite good.
Thanks for the replay.
Regards,
Fayssal El Moufatich
Richard Cotton wrot
Gentlepersons:
A long time ago I used to be able to start R (version 2.6.1) from a
Delphi 7 program and run a script by using a procedure like the following:
function StartRAndWait (CommandLine : string) : Boolean;
var
Proc_info: TProcessInformation;
Startinfo: TStartupInfo;
ExitCode:
On Apr 7, 2009, at 10:04 AM, Yuri Volchik wrote:
Hi,
i'm trying to read some data from excel files but it seems that
neither
xlsReadWrite nor sqlFetch (RODBC) doesn't like the format (Excel 5.0).
When i open the file in Excel and save it in a new format Excel 97
-2003
everything works f
I tried optim using the SANN algoithm. To start things out I tried the example
of solving the "traveling salesman" problem as given in the documentation. The
example works just fine. But if I comment out the line:
set.seed(123) # chosen to get a good soln relatively quickly
More often than not
I am trying to use the "cast" function from the reshape package, where the
formula is not passed in directly, but as the result of the as.formula()
function.
Using reshape v. 0.7.2
I am able to properly melt() by data with:
> molten <- melt(x, id=1:2)
then I can properly cast with this:
Hello,
I am trying to simulate binary outcome data for a logistic regression Monte
Carlo study. I need to eventually be able to manipulate the structure of the
error term to give groups of observations a random effect. Right now I am
just doing a very basic set up to make sure I can recover the p
I am trying to create a graphic output in Sweave but I do not want it to be
standard size. I want the whole graphic to be 80mm of height only, just like
the viewport below.
<>=
pushViewport(viewport(height = unit(80, "mm")))
grid.rect()
grid.text("I want this viewport to be the whole
You are correct, passing in a text string works.
Thanks for a great package
hadley wickham
Sent by: manipul...@googlegroups.com
04/07/09 10:32 AM
Please respond to
manipul...@googlegroups.com
To
ryan.shef...@malbecpartners.com
cc
manipul...@googlegroups.com, r-help@r-project.org
Subject
Re
Hi,
I am trying to make a sequence and am using a for loop for this. I want to
start off with an initial value ie S[0]=0 then use the loop to create other
values. This is what I have so far but I just keep getting error messages.
#To calculate the culmulative sums:
s<-rep(0,207)
Hi Karl,
I mainly have data frames. summarize() does not seem to work with multiple
columns from a data frame. Any suggestion? Thanks.
Jun
On Tue, Apr 7, 2009 at 4:49 AM, Karl Ove Hufthammer <
karl.huftham...@math.uib.no> wrote:
> Jun Shen:
>
> > summarize() can apply multiple functions to one
Hi all,
I'm trying to achieve a few things using the lattice package but am failing
miserably.
I am plotting side by side box plots and using a grouping variable, e.g.
cols <- c("Sepal.Width", "Petal.Length", "Petal.Width")
stackedData <- stack(iris[, cols])
df <- data.frame(y = stackedD
Hi,
my problem is as follows:
I have a matrix of two rows like this:
2 2 3 4 4 4 5 5 6
1 1 2 1 3 3 2 1 1
Can I apply something like "group by" in sql? What I want to achieve
is the some of second row for each unique entry of first row:
2 -> 2 (=1+1)
3 -> 2
4 -> 7 (=1+3+3)
5 -> 3 (=2+1)
6 -
> There seems to be a way for calling R from .net. However, is there anyway
> for calling .net/C# code from R? Something similar to the RJava package
for
> .net?
To the best of my knowledge, there isn't at the moment. The latest release
of MATLAB does though, so in the spirit of
On Tue, 7 Apr 2009, Patrizio Frederic wrote:
Roger,
many thanks for your very useful suggestions.
I've just produced some plot using xlim/ylim. I noticed I can only
zoom in a square box. Is there any way to produce rectangular ones?
What happens is that you are seeing the default square dimens
Hi,
I think it's a FAQ (== vs all.equal to test for equality), and not
related to expand.grid. See ?all.equal and ?"=="
You don't need which, gridd[gridd[,2]=="0.6" , ] would work fine, or
more elegantly (imho),
gridd <- expand.grid(x=x,y=y )
subset(gridd, factor(x) == "0.6")
Hope
stefan.d...@gmail.com:
> I came across a strange behavior of expand.grid (or at least strange to
> me).
>
> For certain values of one of my input variables - created by seq() - I
> have to use strings (e.g ==".6") to select a row of the object
> created by expand.grid(), for other values numerica
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
--
David Winsemius
On Apr 7, 2009, at 10:35 AM, stefan.d...@gmail.com wrote:
Hello,
I came across a strange behavior of expand.grid (or at least strange
to me).
For certain values of one o
Dear List,
I´m working on a classification problem. My response has 60 levels.
I`m very interested in boosted trees like AdaBoost or gradient boosting
machine as implemented in the package "gbm". Unfortunately gbm is only
applicable for 2-class problems.
Is anybody out there who can help m
Jun Shen:
> I mainly have data frames. summarize() does not seem to work with multiple
> columns from a data frame. Any suggestion? Thanks.
summarize() *does* work with multiple columns from data frames, but the
function you use must be able to do column-wise calculations. Example:
with(iris, s
On Tue, Apr 7, 2009 at 8:44 AM, wrote:
>
> I am trying to use the "cast" function from the reshape package, where the
> formula is not passed in directly, but as the result of the as.formula()
> function.
>
> Using reshape v. 0.7.2
>
> I am able to properly melt() by data with:
>
>> molten <- mel
1 - 100 of 137 matches
Mail list logo