Hi,
?sweep
Regards,
Pascal
On 05/02/2013 03:28 PM, Sachinthaka Abeywardana wrote:
Hi all,
I have a feeling the most efficient way to do the following is to use
apply, but I'm still wrapping my head around the function.
k=matrix(1:6,nrow=3)
div=1:2
Questions is how do I get R to divide th
On 02-05-2013, at 08:28, Sachinthaka Abeywardana
wrote:
> Hi all,
>
> I have a feeling the most efficient way to do the following is to use
> apply, but I'm still wrapping my head around the function.
>
> k=matrix(1:6,nrow=3)
>
> div=1:2
>
>
> Questions is how do I get R to divide the firs
I'm a bit of an amateur R programmer. I can do simple R scenarios but my
handle on complex grammatical issues isn't steady.
I have 12 CSV files that I've read into dataframes. Each has 8 columns and
over 200 rows. Each dataframe has data associated by time component
and a date component in
Hi all,
I have a feeling the most efficient way to do the following is to use
apply, but I'm still wrapping my head around the function.
k=matrix(1:6,nrow=3)
div=1:2
Questions is how do I get R to divide the first column by 1 (div[1]) and
the second column by 2 (div[2])
k/div treats k as a ve
Ozgul Inceoglu ulb.ac.be> writes:
>
> I am trying to find the percentage of the parameters explaining the
bacterial community composition. I
> have one data matrix with relative abundance of OTUs and one with
environmental parameters. I used
> varpart in vegan package but the values in the venn
Thanks for all tips/suggestions.. Just a few more comments..
The same code I use with a different data set in another project does not
create those curly braces!
Regards,
Santosh
On Wed, May 1, 2013 at 8:16 PM, Santosh wrote:
> Sorry about the word "brackets".. Yes, I meant curly braces! I h
Thomas,
Thomas Parr maine.edu> writes:
>
> My question is related to partitioning the variance in rda (vegan) results
> for multiple groups of variables. I have a high dimensional dataset with
> 79 explanatory variables and 9 response variables. Within those 79
> explanatory variables there
Thanks Michael!
I solved using the form Pyper example:
def on_calcola_pressed (self):
# bottone per calcoli statistici
from pyper import *
r = R()
r('library(RPostgreSQL)')
r('drv <- dbDriver("PostgreSQL")')
r('con <- dbConnect(drv, host="127.0.0.1", dbname="pyarchinit",
port="5432"
Hi Santosh
Try this :
q <-
data.frame(G=rep(paste("G",1:3,sep=""),each=50),
D=rep(paste("D",1:5,sep=""),each=30),
a=rep(1:15,each=10),t=rep(seq(10),15),
b=round(runif(150,10,20)))
q$grp <- paste(q$D,q$a,sep=":")
q$grp <- ordered(q$grp, levels=unique(q$grp))
q$dc
Hello every one:
I get following warning when building my R package with R-3.0.0.
building 'SPEEDY.tar.gz' Warning in utils::tar(filepath, pkgname,
compression = "gzip", compression_level = 9L, : number of items to replace
is not a multiple of replacement length thanks Michael
I have no idea
On May 1, 2013, at 8:16 PM, Santosh wrote:
> Sorry about the word "brackets".. Yes, I meant curly braces! I have not
> heard of "curley braces"! :). Curly braces surrounding the values of
> "strip.levels" appear on the strip of multipanel plots.
Not in my running of your code.
> Thanks,
>
On May 1, 2013, at 8:37 PM, Thomas Parr wrote:
> This is not a request for coding help so there is no reproducible code,
So this is a general statistical problem?
Perhaps you should try: CrossValidated.com
>
> rather I am trying to figure out if anyone had had a similar experience.
>
> My q
Hi,
Attached are two datasheet to be read.
My raw data "130502temp.xlsx" contains numbers with ' symbols, and they
can't be read as numbers. Even if I copy and paste as numbers to form a new
file "130502temp_number1.xlsx", they could not be read smoothly.
1. How can I read the datasheet
This is not a request for coding help so there is no reproducible code,
rather I am trying to figure out if anyone had had a similar experience.
My question is related to partitioning the variance in rda (vegan) results
for multiple groups of variables. I have a high dimensional dataset with
79
Sorry about the word "brackets".. Yes, I meant curly braces! I have not
heard of "curley braces"! :). Curly braces surrounding the values of
"strip.levels" appear on the strip of multipanel plots.
Thanks,
Santosh
On Wed, May 1, 2013 at 7:44 PM, David Winsemius wrote:
>
> On May 1, 2013, at 6:
HI,
I am not sure what is wrong in your side. I cut and paste the same code and I
get this:
library(plyr)
set.seed(25)
mydf<- data.frame(subid=rep(1:5,each=3),Col=sample(c(0:5,NA),15,replace=TRUE))
retsample <- function(df, Column,size) {
set.seed(1234)
mysel <- ddply(df, .(subid),function(
#or
library(magic)
adiag(table1,table2) #rownames are preserved
# [,1] [,2] [,3] [,4]
#row1 1 1 0 0
#row2 1 2 0 0
#row3 0 0 0 1
#row4 0 0 0 4
A.K.
- Original Message -
From: Dennis Murphy
To: David Winsemius
Cc: arun ; R help
Sent: W
Actually, quite a few journals do ask for .tiff (or, often, also .eps)
only (as part of their webpage instructions) but my experience has been
that many take .pdf without a lot of fuss.
The OP could try and see if pdf will fly. If not, then (s)he can go
for TIFF images. If this is at the journal
Isn't this just a block diagonal matrix?
library(pracma)
blkdiag(table1, table2)
[,1] [,2] [,3] [,4]
[1,]1100
[2,]1200
[3,]0001
[4,]0004
Dennis
On Wed, May 1, 2013 at 5:41 PM, David Winsemius wrote:
> add2blocks <- function(m
On May 1, 2013, at 6:16 PM, Santosh wrote:
> Derar Rxperts,
> I have a strange situation.. I see curly brackets
Wait right here. What do you mean by "brackets"? In some locales, such as mine,
that might mean "[" ; in other domains... well, who knows? I don't see any
"[".
The Urban Legends N
Hi David,
thank yuou so much for helping me!
Il giorno 01/mag/2013, alle ore 10:16, David Carlson ha
scritto:
> You need to clarify what you are trying to achieve and fix some errors in
> your code. First, thanks for giving us reproducible data.
>
i tried to fix the errors , thanks for you
Hi,
If you are using Rstudio, please check this link
(http://support.rstudio.org/help/discussions/problems/850-ddply-misbehaving-in-rstudio-and-only-in-rstudio).
A.K.
- Original Message -
From: arun
To: R help
Cc: David Winsemius
Sent: Wednesday, May 1, 2013 9:49 PM
Subject: Re: R
Derar Rxperts,
I have a strange situation.. I see curly brackets around "strip.levels" in
multipanel strips while using lattice::xyplot. .How do I get rid of the
curly brackets? For some reason, I am not able to reproduce the problem
using an example below...
Any suggestions are highly welcome!
Tha
add2blocks <- function(m1, m2) { res <- cbind(m1, matrix(0, dim(m2)[1],
dim(m2)[2]) )
res <- rbind(res, cbind( matrix(0, dim(m1)[1],
dim(m1)[2]), m2) ) }
new <- add2block(table1, table2)
new
#---
[,1] [,2] [,3] [,4]
row11100
row212
On Wed, May 1, 2013 at 12:28 PM, Stephen Sefick wrote:
> R 2.12.2 on Scientific Linux 6.4
>
> #works
> chron(times.="15:00:00", format=c(times="h:m:s"))
>
> #doesn't work
> chron(times.="15:00", format=c(times="h:m"))
>
> From chron Manual:
> The times format can be any permutation of "h", "m", an
On May 1, 2013, at 22:40 , Lorenzo Isella wrote:
>
>>
>> (A) The example doesn't run for me. library(ares) is not available on
>> current R versions, but even where it is available, it doesn't provide a
>> multinom() function?
>
>
> Apologies, ares is not needed at all. Please find the corr
Look at the output of str(mydata)
'data.frame': 200 obs. of 11 variables:
$ id : num 70 121 86 141 172 113 50 11 84 48 ...
$ female : Factor w/ 2 levels "male","female": 1 2 1 1 1 1 1 1 1 1 ...
$ race : Factor w/ 4 levels "hispanic","asian",..: 4 4 4 4 4 4 3 1 4 3 ...
$
On 5/1/2013 2:49 PM, Frank Harrell wrote:
> Why do you need TIFF? I've never seen a science journal that claims they
> want TIFF figure submissions who are really serious about that. This is a
> very wasteful format. Most journals want PDF.
> Frank
>
There are likely many, but a quick Google is
Hi,
Assuming that your dataset is similar to the one below:
set.seed(25)
dat1<-
data.frame(Algae.Mass=sample(40:50,10,replace=TRUE),Seagrass.Mass=sample(30:70,10,replace=TRUE),Terrestrial.Mass=sample(80:100,10,replace=TRUE),Other.Mass=sample(40:60,10,replace=TRUE),Site.X.Treatment=rep(c("ALA1A","A
On May 1, 2013, at 1:41 PM, David Winsemius wrote:
>
> On May 1, 2013, at 12:31 PM, Pramod Anugu wrote:
>
>> We are using boss package function in R and getting the below error message.
>> Please advice
>>
>> Error: could not find function "boss.set"
>
> Try searching the R-FAQ for "could not
Thanks everyone. I had looked in the documentation (just in the wrong
places,apparently) and googled, but I couldn't find this.
2013/5/1 Rui Barradas :
> Hello,
>
> Try
>
> corpus.df[, c("mph", "mgl", "eng")]
>
>
> Hope this helps,
>
> Rui Barradas
>
> Em 01-05-2013 21:04, Joel Prokopchuk escreveu
try tb[c('name1','name3'), c('col1','col5')]
Hong Qin
Sent from my iPad
On May 1, 2013, at 4:04 PM, Joel Prokopchuk wrote:
> Sorry, the use of rows/columns I found so far was rather
> contradictive, both refering to what can be gotten via subset()
> instead of what I'm looking for.
> Is there
Unless I have misinterpreted, your query indicates that you have made
no attempt to learn how R works. Try reading (relevant sections of)
"An Introduction to R" or other online R tutorials.
?"["
provides a terse but complete answer to your question, I believe.
-- Bert
On Wed, May 1, 2013 at 1:0
On May 1, 2013, at 12:31 PM, Pramod Anugu wrote:
> We are using boss package function in R and getting the below error message.
> Please advice
>
> Error: could not find function "boss.set"
Try searching the R-FAQ for "could not find function".
--
David Winsemius
Alameda, CA, USA
__
Hi Joel,
I have no idea what you actually want, since there's no context in
your email, but you should probably see:
?"["
for information on how to subset a data frame by rows and/or columns
using either numerical indices or names (if appropriate for the
object).
Sarah
On Wed, May 1, 2013 at 4:0
Why do you need TIFF? I've never seen a science journal that claims they
want TIFF figure submissions who are really serious about that. This is a
very wasteful format. Most journals want PDF.
Frank
Aldo wrote
> I am trying to create a high resolution tiff. It is not working.
>
> I am on Windo
Hi,
May be this helps:
dat1<- as.data.frame(table1)
dat2<- as.data.frame(table2)
names(dat2)<-c("V3","V4")
library(plyr)
res<-join(dat1,dat2,type="full")
res[is.na(res)]<- 0
res
# V1 V2 V3 V4
#1 1 1 0 0
#2 1 2 0 0
#3 0 0 0 1
#4 0 0 0 4
combinedtable<-as.matrix(res)
colnames(
We are using boss package function in R and getting the below error message.
Please advice
Error: could not find function "boss.set"
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/list
Hello,
Try
corpus.df[, c("mph", "mgl", "eng")]
Hope this helps,
Rui Barradas
Em 01-05-2013 21:04, Joel Prokopchuk escreveu:
Sorry, the use of rows/columns I found so far was rather
contradictive, both refering to what can be gotten via subset()
instead of what I'm looking for.
Is there a wa
Hello,
To compute the difference between two date/time objects use the minus
operator. See
?difftime
?`-.POSIXt`
Hope this helps,
Rui Barradas
Em 01-05-2013 16:58, Eric Mintah escreveu:
Dear sir/madam,
I used as.Date,strptime, POXIct, and POXIlt functions to
work o
Dear sir/madam,
I used as.Date,strptime, POXIct, and POXIlt functions to
work on my data in R. Please, I would like to know the function to find the
difference between the dates and times in two different columns and make a new
column for that. Thank you
[[alterna
Hi David,
thank yuou so much for helping me!
Il giorno 01/mag/2013, alle ore 10:16, David Carlson ha
scritto:
> You need to clarify what you are trying to achieve and fix some errors in
> your code. First, thanks for giving us reproducible data.
>
i tried to fix the errors and uploaded a ne
Sorry, the use of rows/columns I found so far was rather
contradictive, both refering to what can be gotten via subset()
instead of what I'm looking for.
Is there a way to get multiple colums/rows? Something like
corpus.df${mph,mgl,eng}
Thanks in advance for any answers.
--
Joel Prokopchuk
___
Hi ST,
You could try this:
library(plyr)
set.seed(25)
mydf<- data.frame(subid=rep(1:5,each=3),Col=sample(c(0:5,NA),15,replace=TRUE))
retsample <- function(df, Column,size) {
set.seed(1234)
mysel <- ddply(df, .(subid),function(x)
summarize(x,missing=sum(is.na(x[[Column]])|x[[Column]]==0)))
myids<-
I am trying to create a high resolution tiff. It is not working.
I am on Windows XP 32-bit
R 3.0.0
Code input:
tiff(file="test.tiff",width=6.83,height=6.83,units="in", res=1200)
Return Message:
Error in tiff(file = "test.tiff", width = 6.83, height = 6.83, units =
"in", :
unable to start tif
Hi, Jim,
Thank you very much for your email.
Could you please explain more about the modification about how to adding this
"pch=1,cex=0.2" to the following command line?
biplot(pca2,xlabs=rep(".",19000))
The R document seems to only take text input, whereas "pch=1,cex=0.2" are
actually graph
Hi,
You could use:
library(plyr)
for(i in letters[24:26]) assign(i,mutate(get(i),V4=V2+V3))
x
# V1 V2 V3 V4
#1 1 2 3 5
#2 1 2 3 5
#3 1 2 2 4
#4 1 2 2 4
#5 1 1 1 2
y
# V1 V2 V3 V4
#1 1 2 3 5
#2 1 2 3 5
#3 1 2 2 4
#4 1 2 2 4
#5 1 1 1 2
A.K.
>Dear R Help
I'm using refClass for a complex multi-directional tree structure with possibly
100,000s of nodes. The refClass design is very impressive and I'd love to use
it, but I've found that the size of refClass instances are very large and
creation time is slow. For example, below is a RefClass and no
On May 1, 2013, at 10:55 AM, Stephen Sefick wrote:
> Thanks for the quick replies. I have this working with a similar
> suggestion to what arun suggests. I am just interested in why the option
> to use just h:m isn't supported.
>
> #re: Jeff
> chron(dates.="2009/05/01", times.="15:00:00", form
Sorry everybody. Permutation not selection is the key thing here. My
fault.
What date time formats are suggested?
kindest regards,
Stephen
On 05/01/2013 01:21 PM, Enrico Schumann wrote:
On Wed, 01 May 2013, stephen sefick writes:
Thanks for the quick replies. I have this working with a
On Wed, 01 May 2013, stephen sefick writes:
> Thanks for the quick replies. I have this working with a similar
> suggestion to what arun suggests. I am just interested in why the option
> to use just h:m isn't supported.
>
> #re: Jeff
> chron(dates.="2009/05/01", times.="15:00:00", format=c(dat
This behavior is a property of the chron package, not R. The help file
does say the format should include a permutation of h, m, and s, not a
selection of them. Look at the code chron and you will see several
places where is it assumed that the formats and time strings have exactly
three parts.
HI Stephen,
I am using R 3.0.0. The responses in an old thread
(http://r.789695.n4.nabble.com/times-td3016621.html), suggests some solutions,
but not the one you are looking for.
A.K.
sessionInfo()
R version 3.0.0 (2013-04-03)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_
On Wed, May 1, 2013 at 3:05 PM, Enzo Cocca wrote:
> Hello every body,
> I am using rpy2_2.0.8 with postgres and Qgis.
> The code that I wrote is the following:
>
> def on_calcola_pressed (self):
> # bottone per calcoli statistici
> import rpy2
> imp
> I am trying to do calculations on multiple data frames and do not want to
> create a list of them to go through each one. I know that lists have many
> wonderful advantages, but I believe the better thing is to work df by df
> for my particular situation.
Can you give some details about why y
Hello every body,
I am using rpy2_2.0.8 with postgres and Qgis.
The code that I wrote is the following:
def on_calcola_pressed (self):
# bottone per calcoli statistici
import rpy2
import rpy2.robjects as robjects
import rpy2.robjects
Thanks for the quick replies. I have this working with a similar
suggestion to what arun suggests. I am just interested in why the option
to use just h:m isn't supported.
#re: Jeff
chron(dates.="2009/05/01", times.="15:00:00", format=c(dates=c("y/m/d"),
times="h:m:s"))
chron(dates.="2009/05/01",
HI,
One possible way would be to use paste()
chron(times.=paste0("15:00",":00"),format=c(times="h:m:s"))
#[1] 15:00:00
#or you could use
library(lubridate)
hm("15:00")
#[1] "15H 0M 0S"
A.K.
- Original Message -
From: Stephen Sefick
To: "r-help@r-project.org"
Cc:
Sent: Wednesday, M
A less-than-ancient version of R?
The documentation does not say the dates. argument is optional.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go..
Dear R Helpers,
I am trying to do calculations on multiple data frames and do not want to
create a list of them to go through each one. I know that lists have many
wonderful advantages, but I believe the better thing is to work df by df
for my particular situation. For background, I have already
Dear All,
I fitted two non-nested proportional hazards models using the coxph()
function from package survival. Now, I would like to apply a model
selection test like, e.g., the likelihood ratio test proposed by Vuong.
I found an implementation of Vuong's test in the package 'pscl', but
that
R 2.12.2 on Scientific Linux 6.4
#works
chron(times.="15:00:00", format=c(times="h:m:s"))
#doesn't work
chron(times.="15:00", format=c(times="h:m"))
From chron Manual:
The times format can be any permutation of "h", "m", and "s" separated
by any one non-special character. The default is "h:m:s
If you are asking R-help readers to do your thesis work the answer is probably
no. If you are asking for specific advice on how to carry out some R operations
we need moer information and some idea of what you have already done in R :
http://stackoverflow.com/questions/5963269/how-to-make-a-grea
You need to clarify what you are trying to achieve and fix some errors in
your code. First, thanks for giving us reproducible data.
Once you have read the file, you seem to be attempting to remove cases with
missing values, but you check for missing values of "count" twice and you
never check "de
This comes as an application to this question:
http://stackoverflow.com/questions/5896648/sum-object-in-a-column-between-an-interval-defined-by-another-column/5897695#comment23166107_5897695
What I would like to know is how to adjust the answer if I want to sum the
values in B, for ((A[i+1]-A[i]==
Cool! Thanks!
Enrico
On 1 May 2013, at 14:09, arun wrote:
> match(interaction(choice),interaction(coord))
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read th
You could also use:
which(apply(coord,1,paste,collapse="")%in%apply(choice,1,paste,collapse=""))
#[1] 2 11 12
#or
which(sapply(seq_len(nrow(coord)),function(i)
any(duplicated(rbind(coord[i,],choice)
#[1] 2 11 12
#or
coord$Newcol1<- TRUE
choice$Newcol2<- TRUE
which(!is.na(merge(coord,ch
match(interaction(choice),interaction(coord))
#[1] 2 11 12
A.K.
- Original Message -
From: Enrico R. Crema
To: r-help@r-project.org
Cc:
Sent: Wednesday, May 1, 2013 7:54 AM
Subject: [R] selecting rows based on multiple criteria
Dear List,
I am struggling with the following problem
Hi,
I want to fit a standardized generalized hyperbolic distribution to my data. I
am aware, that I can do this with the dsgh command of the fBasics package along
with the optim command. My problem is, that I also want to have a derivation of
it. So I need the theory behind it, i.e. I need the
Hi,
I want to fit standardized generalized hyperbolic distribution to my data. I am
aware, that I can do this with the dsgh command of the fBasics package along
with the optim command. My problem is, that I also want to have a derivation of
it. So I need the theory behind it, i.e. I need the for
HI,
You could also do:
vec1<- c("Intensity","Intensity L", "Intensity H", "Intensity Rep1")
identical(setdiff(seq_along(vec1),grep("H|L",vec1)),as.integer(c(1,4)))
#[1] TRUE
A.K.
- Original Message -
From: Johannes Graumann
To: r-h...@stat.math.ethz.ch
Cc:
Sent: Wednesday, May 1, 2013
Dear List,
I am struggling with the following problem.
Suppose I have the following data.frame:
coord<-expand.grid(x=1:10,y=1:10)
and I want to extract the row numbers of those matching the criteria defined by
the following data.frame:
choice<-data.frame(x=c(2,1,2),y=c(1,2,2))
the result s
On Wed, May 1, 2013 at 12:19 PM, Fabio Berzaghi wrote:
> so in other words there is no easy way of doing this?
That's not what I said.
It's easy to make a progress bar if you use plyr:e.g.,
ddply(baseball, .(id), mutate, career_year = year - min(year) + 1,
.progress = "time")
Our cautions were
Hello,
The following pattern seems to do it.
grep("^Intensity$|^Intensity\\s[^HL]",
c("Intensity","Intensity L", "Intensity H", "Intensity Rep1"))
Hope this helps,
Rui Barradas
Em 01-05-2013 09:37, Johannes Graumann escreveu:
Hello,
Banging my head against a wall here ... can anyone li
try this:
> identical(
+ grep(
+ "^Intensity *[HL]",
+ c("Intensity","Intensity L", "Intensity H", "Intensity Rep1"),
+ invert = TRUE),
+ as.integer(c(1,4)))
[1] TRUE
>
On Wed, May 1, 2013 at 4:37 AM, Johannes Graumann
wrote:
> Hello,
>
> Banging my head against a wall here ...
so in other words there is no easy way of doing this?
I don't want to spend too much time figure out how this progress bar works.
I am not clear if the code should run in the main R or where.
On 4/30/2013 13:11, R. Michael Weylandt wrote:
On Tue, Apr 30, 2013 at 10:40 AM, Fabio Berzaghi wrote:
On 05/01/2013 02:46 AM, capricy gao wrote:
I noticed that the points on the biplot are not exactly the same as the
predicted values.
Could any body give me a hint about why?
Hi capricy,
If you mean the points that would result from the suggestion I sent
yesterday, it is probably because usi
Hi,Has anybody worked with thornthwaite method to calculate the daily
evapotranspiration ? I have used the following code to calculate monthly
evaporation but what I need is daily evapotranspiration.
Epot <- thornthwaite(Tave, lat, na.rm = FALSE) # Evaluates evapotranspiration
for each month.
D
Hello,
Banging my head against a wall here ... can anyone light the way to a
pattern modification that would make the following TRUE?
identical(
grep(
"^Intensity\\s[^HL]",
c("Intensity","Intensity L", "Intensity H", "Intensity Rep1")),
as.integer(c(1,4)))
Thank you for your time.
On Wed, 1 May 2013, Elaine Kuo wrote:
Hello,
I am work with a linear regression model:
y=ax+b with the function of lm.
y= observed migration distance of butterflies
x= predicted migration distance of butterflies
Usually the result will show
if the linear term a is significantly different
On Tue, 30 Apr 2013, Paul Johnson wrote:
Greetings to r-help land.
I've run into some program crashes and I've traced them back to
methods() behavior after the package gdata is loaded. I provide now a
minimal re-producible example. This seems bugish to me. How about you?
dat <- data.frame(
81 matches
Mail list logo