Hi all,
I have in my code some vectors that are not of equal size. I would like to be
able for each of these vectors select 6 elements that are (almost) equally
spaced. So the first one would be at (or close) to the beginning the last one
at (or close) to the end and the other 4 equally spaced b
Helloï¼
I use the "egonet" function and have a problem
idx <- sapply(mats,index.egonet)
idx <- as.data.frame(t(idx))
idx <- cbind(idx,filename=rownames(idx))
data <- merge(data,idx,by="filename")
cannot coerce class ""function"" to a data.frame
can someone please help me with this problm
Hello, Alaois,
if x is your vector maybe
n <- length( x)
positions <- trunc( quantile( seq( n), prob = 0:5/5))
x[ positions]
comes close to what you want.
Hth -- Gerrit
Hi all, I have in my code some vectors that are not of equal size. I
would like to be able for each of these vectors sel
Alaios yahoo.com> writes:
> I have in my code some vectors that are not of equal size.
I would like to be able for each of these vectors
> select 6 elements that are (almost) equally spaced.
So the first one would be at (or close) to the beginning
> the last one at (or close) to the end and the
you never defined "data" and "data" is a function in the "base".
type in "data" just before "merge" and see what is output (debuggung 101)
Sent from my iPad
On Oct 30, 2013, at 4:38, hsin-fei tu wrote:
> Hello:
>
> I use the "egonet" function and have a problem
>
> idx <- sapply(mats,index.e
Dear R forum,
Just want to know if there is any function / package in R which will calculate
Yield to Maturity in R for a given bond?
Regards
Katherine
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.eth
Hi everybody,
I have data in the format of the example data below where essentially a
large number of indicator variables (coded [0,1]) reflect traits of the
same id across multiple rows. I need to represent the data in a 1 row per
id format. I see this as being similar to converting from long to
Thumbs up! It worked!
On Wednesday, October 30, 2013 9:41 AM, Gerrit Eichner
wrote:
Hello, Alaois,
if x is your vector maybe
n <- length( x)
positions <- trunc( quantile( seq( n), prob = 0:5/5))
x[ positions]
comes close to what you want.
Hth -- Gerrit
> Hi all, I have in my code
Hello,
If I understand it correctly, just change mysum to the following.
mysum<-function(x) tapply(x,d1$id,sum)
Hope this helps,
Rui Barradas
Em 30-10-2013 11:07, Dan Abner escreveu:
Hi everybody,
I have data in the format of the example data below where essentially a
large number of indi
Presumably you need to define 'buzz' first, but I don't see evidence that
you've done so.
Michael
On Oct 30, 2013, at 0:06, Erin Hodgess wrote:
> Hello again!
>
> I'm using python with a module rpy2 to call functions from R.
>
> It works fine on built in R functions like rnorm.
>
> However
On 28 October 2013 14:26, Anindita Chattopadhyay
wrote:
> We need to understand how we can implement this in Revo R.
Most of the people here contribute to community of R not Revo R. I
think it is unfair of you to request from this list to solve your Revo
R issue.
Your question doesn't make much sense if you really believe that the best fit
is to draw a horizontal line at every unique value of y. What is the
actual problem you are trying to solve? Clearly it's not a matter of
linear fits, so forget about using "lm" or other regression tools.
--
View
Hi Rui,
Thanks for responding. When I make this change, I get an error message:
> mysum<-function(x) tapply(x,d1$id,sum)
>
> d2<-apply(d1[2:4],mysum)
Error in match.fun(FUN) : argument "FUN" is missing, with no default
Thoughts?
On Wed, Oct 30, 2013 at 8:01 AM, Rui Barradas wrote:
> Hello,
>
Did you run the identical code on the identical machine, and did you verify
there were no other tasks running which might have limited the RAM available
to R? And equally important, did you run these tests in the reverse order
(in case R was storing large objects from the first run, thus chewing u
Dunno how to break this to you, but R reads exactly what is in that file,
with the data in exactly the proper row/column locations.
--
View this message in context:
http://r.789695.n4.nabble.com/Can-not-read-Excel-file-correctly-tp4679306p4679350.html
Sent from the R help mailing list archive
Which suggests the OP should verify that the data in "...$Frequency" is the
data he expects to be there.
Rui Barradas wrote
> Hello,
>
> I can't reproduce your error:
>
> windfreq <-
> c(1351L, 2147L, 3317L, 4378L, 5527L, 6667L, 7865L, 8970L, 9987L,
> 10907L, 11905L, 12642L, 131000L, 14983L, 1
Hi,
I'm looking for a function that takes a list and calculates a score based on
how well "like attracts like".
For example:
list1 <- c(john, eric, steve, john, eric, scott, john)
list2 <- c(john, john, john, eric, eric, steve, scott)
score(list1) < score(list2)
Both lists are composed of the s
All was run on the identical machine in independent sessions. I did not
restart Windows. I also tried 32bit R 3.0.2 and it seemed slightly
faster than 64bit.
Using Process Explorer v15.23
(http://technet.microsoft.com/de-de/sysinternals/bb896653) my impression
was that R 3.0.2 manages memory in
On 10/30/2013 06:00 AM, r-help-requ...@r-project.org wrote:
Hi,
I'm having the following loop:
result<- vector("list",100)
for (i in 1:max(dat$simNumber))
{
result[[i]]<-survfit(Surv(dat[dat$simNumber==i,]$TAFD,dat[dat$simNumber==i,]$DV)~1)
}
In a next step, I would like to calculate the
I'm not sure if this is correct behavior or not, but it seems counterintuitive
to me:
dat <- data.frame(id=1:5, let=letters[1:5])
# A. omits the first row
dat[- 1, ]
# B. unexpectedly omits ALL rows
dat[- integer(0), ]
It would be less surprising if there were no rows omitted in the (B) case.
I did...just didn't show it
On Wed, Oct 30, 2013 at 7:01 AM, Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> Presumably you need to define 'buzz' first, but I don't see evidence that
> you've done so.
>
> Michael
>
> On Oct 30, 2013, at 0:06, Erin Hodgess wrote:
>
> > Hello again!
> >
>
Hi, Jack,
well, I disagree: What do you expect to grab out of a bucket (= data
frame) if you do not at all grab into it (indexing with an _empty_ index,
i.e. with nothing)? And changing the sign of nothing is still nothing ...
Hth -- Gerrit
On Wed, 30 Oct 2013, Jack Tanner wrote:
I'm not
Hi,
May be:
apply(d1[3:5],2, mysum)
var1 var2 var3
1 2 0 1
2 2 2 3
3 1 1 1
4 0 1 0
#or
sapply(d1[3:5],mysum)
#or
library(plyr)
ddply(d1[,-2],.(id),colwise(sum))
A.K.
On Wednesday, October 30, 2013 8:30 AM, Dan Abner wrote:
Hi Rui,
Thanks for responding.
> > dat[- integer(0), ]
> > unexpectedly omits ALL rows
> >
> > It would be less surprising if there were no rows omitted in the (B) case.
I tried this on two experienced R users here and their first thought* was,
interestingly, as Jack indicated; that -integer(0) should drop nothing.
But
On 29 Oct 2013, at 21:35 , Rolf Turner wrote:
> On 10/29/13 19:44, peter dalgaard wrote:
>
>
>
>> There really is no substitute for knowledge and understanding! Did it not
>> occur to you that the Windspeed column needs to enter into your analysis?
>
>
>
> Fortune!
Actually, I felt
Hello!
I am using ggplot2 (see the code below) to plot the data in 'myplotdata'.
The first column of 'myplotdata' is called "att.levels" and contains
strings; the second column is called "WTP" and contains numeric values.
Notice - I use 'coord.flip()'
The command aes(x=att_levels, y=WTP), if I un
I have a Shiny code that is working.
In this code, the user uploads some input files, then runs some analyses
(using an actionButton), gets some outputs displayed and can also download
some results.
I am testing this code. After I've run the analysis and have made some
small change to the code, I
I can't help you with cell A1, but I can make a guess at your date format
issue. To start, I would suggest you read thoroughly the XLConnect
documentation for how it handles dates (and probably also ?Date in R).
In both Excel and R, dates are stored internally as a number, and then
displayed with
What would the calculated score be for the example you give?
Jean
On Wed, Oct 30, 2013 at 7:03 AM, Stevan Lauriault <
stevan.lauria...@gmail.com> wrote:
> Hi,
>
> I'm looking for a function that takes a list and calculates a score based
> on
> how well "like attracts like".
> For example:
>
> l
Could you produce a full working example then? Bit hard to debug without
knowing what you did.
Michael
On Oct 30, 2013, at 9:11, Erin Hodgess wrote:
> I did...just didn't show it
>
>
> On Wed, Oct 30, 2013 at 7:01 AM, Michael Weylandt
> wrote:
>> Presumably you need to define 'buzz' first
Erin, one question, can you access the defined functions by key?
In lieu of:
> x = R.r.buzz(3)
Can you do:
x = R.r['buzz'](3)
Alternatively if you need only one or two custom functions have you
considered just defining them via python as in:
PStr = """
function(LM) {
S <- summary(LM);
pr
apply() is a different function from sapply() and has different
arguments.
-
David L Carlson
Deparment of Anthropology
Texas A&M University
College Station, TX 77840-4352
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-pr
> I
> get warnings (one for each file) that look like this:
>
> Warning in dir.create(dir) :
>
> 'C:\Users\DIMITR~1.LIA\AppData\Local\Temp\RtmpklHtMJ\435e92e733e5f0
> a8a00f342d'
> already exists
>
> It is still working. But: how could I get rid of these warnings?
Delete the temporary files be
Try making att_levels (or att.levels, whatever you really call it)
into a factor with the levels in the order you like. E.g.,
aes(x = factor(att_levels, levels=unique(att_levels)), y = WTP)
instead of
aes(x = att_levels, y = WTP)
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
>
Here we go:
> buzz
function(x) {
y <- x + pi
return(y)
}
> q()
Save workspace image? [y/n/c]: python
Save workspace image? [y/n/c]: y
root@erinminfo [/home/erinminf/public_html]# python
Python 2.7.5 (default, Sep 11 2013, 02:14:06)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "co
This is Circle 8.1.13 of 'The R Inferno'.
http://www.burns-stat.com/documents/books/the-r-inferno/
Pat
On 30/10/2013 13:04, Jack Tanner wrote:
I'm not sure if this is correct behavior or not, but it seems counterintuitive
to me:
dat <- data.frame(id=1:5, let=letters[1:5])
# A. omits the firs
Hi,
I have some code that you can simply execute:
require(plotrix)
test<-matrix(data=rnorm(1,-100,5),nrow=100)
color2D.matplot(test,axes="F",xlab="",ylab="",main="color.scale",
extremes=c("#FF","#00"),show.legend=FALSE)
axis(1,at=seq(1,ncol(test),length.out=10),labels=seq(201,300,
On Oct 30, 2013, at 4:07 AM, Dan Abner wrote:
> Hi everybody,
>
> I have data in the format of the example data below where essentially a
> large number of indicator variables (coded [0,1]) reflect traits of the
> same id across multiple rows. I need to represent the data in a 1 row per
> id for
On Oct 30, 2013, at 6:04 AM, Jack Tanner wrote:
> I'm not sure if this is correct behavior or not, but it seems
> counterintuitive
> to me:
>
> dat <- data.frame(id=1:5, let=letters[1:5])
> # A. omits the first row
> dat[- 1, ]
>
> # B. unexpectedly omits ALL rows
> dat[- integer(0), ]
>
> I
Hi David,
1) Thanks very much. Your code shows that this was much simpler than I
anticipated.
2) I have made the appropriate changes to email in plain text. My apologies.
Thanks!
Dan
On Wed, Oct 30, 2013 at 1:17 PM, David Winsemius wrote:
>
> On Oct 30, 2013, at 4:07 AM, Dan Abner wrote:
>
>
You should cc r-help on all correspondence so everyone can follow the
thread.
Clearly I'm missing something. Perhaps others are, too. I don't know
what you mean by "a score based on the co-localization of names" unless you
give an example.
Jean
On Wed, Oct 30, 2013 at 10:34 AM, Stevan Lauria
Indeed, it helped - thank you, Bill.
And now - how could I now avoid the reversal on my axis with att_levels?
Currently it starts with the last one being the first one on the graph and
ends with the first one...
On Wed, Oct 30, 2013 at 12:04 PM, William Dunlap wrote:
> Try making att_levels (or
Solve:
I wrote the buzz function to buzz.R
And now I have:
from rpy2.robjects.packages import SignatureTranslatedAnonymousPackage as
STAP
with open("buzz.R","r") as f:
string = '''.join(f.readlines())
buzz = STAP(string,"buzz")
buzz.buzz(3)
And all is well!
Thanks,
Erin
On Wed, Oct 30,
Hello!
I am using ggplot2:
ggplot(myplotdata, aes(x=att_levels, y=WTP)) +
geom_bar(stat="identity",fill="dark orange",colour="black",
alpha = 1,position = "identity") +
geom_text(aes(label=WTP),colour="black",size=4,hjust=1.1,position='dodge') +
coord_flip() +
Just guessing, would the following help?
list1 <- c("john", "eric", "steve", "john", "eric", "scott", "john")
list2 <- c("john", "john", "john", "eric", "eric", "steve", "scott")
max(rle(list1)$lengths)
max(rle(list2)$lengths)
Clint
Clint BowmanINTERNET: cl...@ecy.wa.g
Claudia,
You should cc r-help on all correspondence so that others can follow the
thread.
In the second paragraph of the link I sent you
http://www.r-bloggers.com/maps-in-r-choropleth-maps/
a link is provided for the NUTS data,
"The polygons for drawing the administrative boundaries wer
I see a big 2.15.2/3.0.2 speed difference in parse() (which is used by source())
when it is parsing long vectors of numeric data. dump/source has never been an
efficient
way of transferring data between different R session, but it is much worse
now for long vectors. In 2.15.2 doubling the size
I have over 200 CPUs could write to the same file at the same time, does
someone know how to handle the multiple concurrent write in R?
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/list
Hi Jim,
thats the second time that you helped me in a short while so thanks a lot!
But it seems to me quite laborious and error-prone to first select
all the relevant countries in this long list and then to create a
color vector.
But perhaps I get it all wrong.
For the color vector I fi
> > It would be less surprising if there were no rows omitted in the (B) case.
-integer(0) is identical to integer(0), so how could '[' handle them
differently?
> Yes. It is surprising. It is also teh reason why the construction is also not
> returning what a
> user might expect:
>
> dat[-whic
Both PBurns and DWin are correct. I just thought I'd add a clunky "safety
check" approach I use now and then:
Before doing the actual subset, i.e. df[-which(something),] , do
something like
if (length(which(something)) <1 ) {skip the subsetting} else
df[-which(something)]
--
View this
Dear all,
It does not work function getWeights in the fPortfolio package.
Returns a vector instead of a matrix.
can anyone help me?
Thanks in advance.
Massimiliano
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https
I don't believe that rpy2 will load a saved workspace. When I have worked
with this I always load my functions by sourcing an r file separately:
R.r['source'](MyFuncs.r)
Best,
Collin.
On Wed, 30 Oct 2013, Erin Hodgess wrote:
> Here we go:
>
> > buzz
> function(x) {
> y <- x +
I think the answer is no. Use the master process to manage IO.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
if you don't need to exchange big data between r and python, pyper might be
better than rpy2.
On Oct 30, 2013 12:08 AM, "Erin Hodgess" wrote:
> Hello again!
>
> I'm using python with a module rpy2 to call functions from R.
>
> It works fine on built in R functions like rnorm.
>
> However, I would
Best thanks for confirming my impression. I use dump for storing large
data.frames with a number of attributes for each variable. save/load is
much faster, but I am unsure, if such files will be readable by R
versions years later.
What format/functions would you suggest for data storage/transfer
On Linux, at least, you can have various processes write into the same file, by
opening
it with "r+" mode and calling seek() to position the file pointer before
writing. E.g.,
> library(parallel)
> cl4 <- makeCluster(4)
> tf <- tempfile()
> cat(rep("", 2*length(cl4)), sep="\n", file=tf
You could use the mar= argument of the par() function to define a wider
plot margin on the right, then change the first and third arguments of
color.legend() to make the legend fit in the margin. For example,
par(mar=c(3, 1, 3, 7))
color2D.matplot(test, axes="F", xlab="", ylab="", main="color.sca
I have to defer to others for policy declarations like how long
the current format used by load and save should be readable.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: Heinz Tuechler [mailto:tuech...@gmx.at]
> Sent: Wednesday, October 30, 2013 1:4
On 10/30/2013 11:03 PM, Stevan Lauriault wrote:
Hi,
I'm looking for a function that takes a list and calculates a score based on
how well "like attracts like".
For example:
list1<- c(john, eric, steve, john, eric, scott, john)
list2<- c(john, john, john, eric, eric, steve, scott)
score(list1)<
On 10/31/2013 03:04 AM, palad...@trustindata.de wrote:
Hi Jim,
thats the second time that you helped me in a short while so thanks a lot!
But it seems to me quite laborious and error-prone to first select all
the relevant countries in this long list and then to create a color vector.
But perhaps
Hi again.
I'm putting together a little project with R, python, and a website. So I
have an HTML file, a py file, an R file.
Here is the HTML file:
Integrate
Differentiate
Graph
Function
Now the radio4.py file:
# Import modules for CGI handling
import cgi, cgitb
from sympy import *
impo
Hi,
Whenever I try to open R from Emacs, it says :
"apply: Searching for program: permission denied, Rterm"
I have the new ESS with the latest Emacs version and R-3.0.2. Also, when I
open Emacs, it says : "No version of R could be found on your system". I
wonder if there is anything I could do to
Hi everyone,
I have a data frame with email addresses in the first column and in the second
column a list of times (of different lengths) at which an email was sent from
the
user in the first column.
Here is an example of my data:
Email Email_sent
j...@doe.com "2013-09-26 15:59:55" "2013-09-2
I am trying to compare two different GAM fits.
I have something like
Course.bam20 <-bam(zGrade ~ Rep + ISE + White + Female + Years + AP_TOTAL
+ MATH + HSGPA+ EOP + factor(P7APrior, ordered = FALSE)+s(Yfrm7A,k=20),
data= Course, na.action = na.exclude,samfrac =0.1)
Course.bam4 <-bam(zGrade ~ Rep
Erin can you share the internal error details?
As a first guess are the files executable by all? CGI requires world rwx.
Best,
Collin.
On Wed, 30 Oct 2013, Erin Hodgess wrote:
> Hi again.
>
> I'm putting together a little project with R, python, and a website. So I
> have an H
Hi again:
Here is the web output:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, webmas...@erinm.info and inform
them of the time the error occurred, and anything you might have
67 matches
Mail list logo