Dear R users,
I would like to produce a lattice graph that keeps the ticks at the joining
sides of the panels.
For example:
library(lattice)
library(datasets)
xyplot(lat ~ long | cut(depth, 2), data = quakes, between=list(x=1))
You can see that ticks are plotted at the sides 1 (bottom), 2 (rig
Le lundi 25 février 2013 à 20:26 -0300, Pablo Menese a écrit :
> I use to work whit stata dataframe, so, when I use R I type read.dta
> Until today I do that without any problem, after type:
>
> mydata<-read.dta("C:/dropbox/dataframe.dta")
> attach(mydata)
>
> Everything works great... but today,
On 26/02/2013 09:55, Milan Bouchet-Valat wrote:
Le lundi 25 février 2013 à 20:26 -0300, Pablo Menese a écrit :
I use to work whit stata dataframe, so, when I use R I type read.dta
Until today I do that without any problem, after type:
mydata<-read.dta("C:/dropbox/dataframe.dta")
attach(mydata)
Hi,
I need to generate complex graphics which have to be shown in the plot window
but also in pdf file, and they must have A4 size. This is the reason why I use
width=8.27 and heigth=11.69.
The problem is that I don't make it runs when I put something (text, lines, and
so on) outside the plo
Hi Eva
Apparently no problem for me with Win 7 as far as I can see. Perhaps
returning to the command window may be a problem?
R version 2.15.2 (2012-10-26)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1]
LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
LC_MONETARY=Eng
Dear all,
I have a piece of code that I want to run in parallel (I am working in system
of 16 cores)
foreach (i=(seq(-93,-73,length.out=21))) %dopar%
{
threshold<-i
print(i)
do_analysis1(i,path)
do_analysis2(i,path)
do_something_else_analysis1
Hi again,
Thanks for Anthony about the links on reproducible codes.
Thanks for Rui about ordering when rows are intact.
One more question
Here is your code.
x <-
cbind(
sample( LETTERS[1:6] , 100 , replace = TRUE ) ,
sample( LETTERS[1:6] , 100 , replace = TRUE )
Have you tried using an "at" list in the x and y components of the
"scales" list argument to xyplot?
The docs say that that list should be as long as the number of panels,
indicating that you get tic marks drawn for all panels. And I assume
you can specify no tics drawn for some. Presumably this
Perhaps you want to tell people where the advantage is comparing it with
the very well established R package system.
Best,
Uwe Ligges
On 26.02.2013 02:43, ivo welch wrote:
Dear R-Help group:
I have been tinkering with how I want my personal standard library
functions to look like. They are
On 26.02.2013 14:00, Alaios wrote:
Dear all,
I have a piece of code that I want to run in parallel (I am working in system
of 16 cores)
foreach (i=(seq(-93,-73,length.out=21))) %dopar%
{
threshold<-i
print(i)
do_analysis1(i,path)
do_analysis2(i,pa
Folks,
I have been using the cf function from the "financial" package for a few
years now.
Upon updating my version of R to ... I found that the package no longer exists
in the main collection of R packages.
Has this package been renamed or merged with another package?
If the functionality i
On 26/02/2013 14:45, Keith Weintraub wrote:
Folks,
I have been using the cf function from the "financial" package for a few
years now.
I believe it was never converted for 2.14.0 (it was last touched in
2006, and did not have a NAMESPACE file until CRAN auto-generated one),
and the mainta
there may be no advantage at all. I don't even know a full set of the
choices here. if someone does know all the choices, it would be good to
point out to readers why my design choices are worse and/or what the
alternatives are. some of it is, of course, simply taste.
I like the simplicity and
# 'I need help combining 2 dataframes (df1 & df2) into a 3rd (mydf).
I want the 3rd dataframe to contain 1 row for each row in df1 & df2,
and all the columns in both df1 & df2. # Advice is appreciated. Thank
you.
df1 <- data.frame(matrix(data=c(7, 99, 12) , nrow=1 , dimnames =
list( NULL , c('a
df1 <- data.frame(matrix(data=c(7, 99, 12) , nrow=1 , dimnames =
list( NULL , c('a' , 'b' , 'd') ) ) )
df2 <- data.frame(matrix(data=c(88, 34, 12, 44, 56) , nrow=1
,dimnames = list( NULL , c('d' , 'b' , 'x' , 'y', 'c') ) ) )
I figured it out.
mydf <- merge(df2,df1,all.y=T, all.x=T)
mydf2 <-
Hello,
I'm not sure I understand, do you want to treat BCC, CBC and CCB as the
same? If so try
w2 <- apply( y , 1 , function(x) paste0(sort(x) , collapse = "" ))
table(w2)
Hope this helps,
Rui Barradas
Em 26-02-2013 13:58, Niklas Fischer escreveu:
Hi again,
Thanks for Anthony about the
Hi,
I would like to cut a vector of values in parts.
Each part should have an equal number of elements.
for example:
x <- (rnorm(500)^2)
now I want 5 vectors each with 100 elements.
The first vector should include the 100 lowest values of x and so on
(so that the fifth vector contains the 100 h
I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9. I want to
make an indicator variable that will take value 1 if NAM=7 or NAM=8 or
NAM=9. How can I do that?
I usually do: Var001<- ifelse(NAM==7,1,0) for the simplest case.
[[alternative HTML version deleted]]
__
Hi,
I am not quite sure what you meanÎ. I give again reproducible code:
require(ggplot2)
require(reshape)
DataToPlot<-matrix(data=rnorm(9),nrow=3,dimnames=list(seq(1,3),seq(4,6)))
tdm<-melt(DataToPlot)
p<- ggplot(tdm, aes(x = X2, y = X1, fill = factor(value))) +
               Â
tasnuvat wrote
> I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9. I want to
> make an indicator variable that will take value 1 if NAM=7 or NAM=8 or
> NAM=9. How can I do that?
> I usually do: Var001<- ifelse(NAM==7,1,0) for the simplest case.
>
> [[alternative HTML version dele
On 26-02-2013, at 18:45, Tasnuva Tabassum wrote:
> I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9. I want to
> make an indicator variable that will take value 1 if NAM=7 or NAM=8 or
> NAM=9. How can I do that?
> I usually do: Var001<- ifelse(NAM==7,1,0) for the simplest case.
How
?sort
?cut
On Tue, Feb 26, 2013 at 12:39 PM, Martin Batholdy
wrote:
> Hi,
>
> I would like to cut a vector of values in parts.
> Each part should have an equal number of elements.
>
> for example:
>
> x <- (rnorm(500)^2)
>
> now I want 5 vectors each with 100 elements.
> The first vector should i
Thanx all, I found my answer. I prefer Peter's second solution.
On Tue, Feb 26, 2013 at 11:59 PM, Berend Hasselman wrote:
>
> On 26-02-2013, at 18:45, Tasnuva Tabassum wrote:
>
> > I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9. I want to
> > make an indicator variable that will
Nicole,
Since you seem more interested in accusing David of being rude than
recognizing your own rudeness and taking steps to overcome that and
increase your chance of getting useful responses I will quote a few lines
from the posting guide for you (the entire posting guide is available from
the l
Are you sure you didn't get you threads mixed up? Your original
question was about changing font size and background colors...
See inline for answers to this new question.
On Tue, Feb 26, 2013 at 12:45 PM, Alaios wrote:
> Hi,
> I am not quite sure what you meanΙ. I give again reproducible code:
#I want to "merge" or "join" 2 dataframes (df1 & df2) into a 3rd
(mydf). I want the 3rd dataframe to contain 1 row for each row in df1
& df2, and all the columns in both df1 & df2. The solution should
"work" even if the 2 dataframes are identical, and even if the 2
dataframes do not have the same
Hi,
You could also try:
library(gtools)
smartbind(df2,df1)
# a b d
#1 7 99 12
#2 7 99 12
When df1!=df2
smartbind(df1,df2)
# a b d x y c
#1 7 99 12 NA NA NA
#2 NA 34 88 12 44 56
A.K.
- Original Message -
From: Anika Masters
To: r-help@r-project.org
Cc:
Sent: Tuesday, Febr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Anika Masters
> Sent: Tuesday, February 26, 2013 10:56 AM
> To: r-help@r-project.org
> Subject: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?
>
> #I want to "merg
Hello,
Try the following.
x <- rnorm(500)^2
split(x, cut(x, quantile(x, probs = seq(0, 1, by = 0.2
Hope this helps,
Rui Barradas
Em 26-02-2013 17:39, Martin Batholdy escreveu:
Hi,
I would like to cut a vector of values in parts.
Each part should have an equal number of elements.
for e
Hi All,
I have a data set of around 17,000 gene names and their lengths. E.g.
gene kblength
A3GALT2 14.333
AADACL3 12.609
AADACL4 22.532
ABCA4 128.312
ABCB10 42.114
ABCD3 100.287
.
and I
Dear List,
I have the following code:
x <-c(0, 13.8, 38.16667, 62.16667,
85.91667, 108.9167)
y <-c(1.77, 2.39, 3, 2.65, 2.62, 1.8)
Interpolated <- approx(x, y,xout=0:tail(x, n=1),method="linear")
plot(Interpolated)
in this code x is time in hours (
Insert "include.lowest=TRUE" or the lowest value will get dropped (assigned
NA):
split(x, cut(x, quantile(x, probs = seq(0, 1, by = 0.2)),
include.lowest=TRUE))
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station,
Hi Andras,
This may be too simplistic, but how about
with(Interpolated, x[y==2][1])
?
On Tue, Feb 26, 2013 at 4:21 PM, Andras Farkas wrote:
> Dear List,
>
> I have the following code:
>
> x <-c(0, 13.8, 38.16667, 62.16667,
> 85.91667, 108.9167)
> y
What have you tried so far?
The points function will add points to an existing graph (base) and the
text function will add text to an existing graph.
If those don't do what you need then give us some more details.
On Tue, Feb 26, 2013 at 2:04 PM, Debs Majumdar wrote:
> Hi All,
>
> I have a da
Each of the data sets contains monthly observations on price indices for 7
countries. I use the fitted values from reg1 in the reg2 model. The interior
loop executes without error as long as I explicitly specify the data set, i.e.
data=dat70. However the code fails to execute if I specify the mo
On Feb 26, 2013, at 1:04 PM, Debs Majumdar wrote:
> Hi All,
>
> I have a data set of around 17,000 gene names and their lengths. E.g.
>
> gene kblength
> A3GALT2 14.333
> AADACL3 12.609
> AADACL4 22.532
> ABCA4 128.312
> ABCB10
Clumsy but it doesn't require any packages:
merge2 <- function(x, y) {
if(all(union(names(x), names(y)) == intersect(names(x), names(y{
rbind(x, y)
} else merge(x, y, all=TRUE)
}
merge2(df1, df2)
df3 <- df1
merge2(df1, df3)
--
David L Carlso
f <- function(x, y, criticalY) {
# return x value of first upcrossing of y past criticalY
stopifnot(length(x) == length(y), length(x)>1, length(criticalY)==1)
i <- seq_along(x)[-1]
w <- which(y[i] >= criticalY & y[i-1] <= criticalY)[1] # pos of first
upcrossing
if (is.na(w)) { # no
On 02/27/2013 08:04 AM, Debs Majumdar wrote:
Hi All,
I have a data set of around 17,000 gene names and their lengths. E.g.
gene kblength
A3GALT2 14.333
AADACL3 12.609
AADACL4 22.532
ABCA4 128.312
ABCB10 42.114
ABCD3100.287
.
On Feb 26, 2013, at 1:53 PM, Richard Saba wrote:
> Each of the data sets contains monthly observations on price indices for 7
> countries. I use the fitted values from reg1 in the reg2 model. The interior
> loop executes without error as long as I explicitly specify the data set,
> i.e. data=d
Hi David,
Thanks for your suggestions.
I am not sure how to plot the points by using gene names, but I will give it a
try.
Thanks,
Debs
From: David Winsemius
Cc: "r-help@r-project.org"
Sent: Tuesday, February 26, 2013 1:54 PM
Subject: Re: [R] Adding m
On Feb 26, 2013, at 2:28 PM, Debs Majumdar wrote:
> Hi David,
>
> Thanks for your suggestions.
>
> I am not sure how to plot the points by using gene names, but I will give it
> a try.
The x and y arguments would be the same as were used in the text() call.
(You are _still_ sending formatte
Dear R community,
My question is not a quick fix one but it would be helpful if you have any
advice for me.
I have a large data set of many locations in the US and all of these
locations are expressed in coordinates (longitudes and latitudes). I need a
tool which returns the state that each locat
Hi,
See
http://stackoverflow.com/questions/8751497/latitude-longitude-coordinates-to-state-code-in-r
Best,
Ista
On Tue, Feb 26, 2013 at 5:35 PM, Onur Uncu wrote:
> Dear R community,
>
> My question is not a quick fix one but it would be helpful if you have any
> advice for me.
>
> I have a lar
Hi,
I try to make multiple plots look as similar as possible.
I create each plot with pdf(), using the same height but different width in
inch.
For some plots I use the layout() function to draw multiple subplots side by
side in one pdf.
For each plot I use the same cex values for the differe
Hello List,
I'm trying to get behind the secrets of rJava, especially how to run an
R session within a java Programm **and especially how wo inspect objects
of an R workspace from within a java program**
But as I can't find any documentation on the Java side of rJava, I tried
to learn somethin fr
Hi everyone,
I am trying to run the example of multistate occupancy model from the book
Bayesian Population Analysis using WinBUGS (Marc Kéry and Michael Schaub):
This example is available on
http://www.vogelwarte.ch/code-for-running-bpa-using-jags.html
When I try to run the first line of this s
Hello all,
I want to set (x_1, x_2, \dots, x_n) in a bold font within R documentation. I
wrote
\deqn(\bold{x}_1, \bold{x}_2, \ldots, \bold{x}_n),
but when Rstudio shows HTML preview of the documentation, x is not
bold and \bold{x} is illustrated instead. The other latex math bold producer
su
Dear R-help,
I wrote the following lines in order to use a variable from a parent
frame in my callM() function. I would like to solve this by only editing
the callM(function). When I run this code I obtain a empty list, meaning
that eval(ls(),sys.frame(-1)) could not access the variables in th
Hi all,
My package passed Rcmd check successfully. but
in constructed PDF format of R documentation, within the examples
section, half of the line (R code) is out of the paper. I also found
another CRAN submitted package, ftsa , that suffer from overfulling in a line
too, see ftsa Reference m
I am having difficulty getting the dynamic tree cut package to work.
Given the data table "myddtable"
LengthPlaceColorAge5HRed224ABlue205WGreen243GRed222GBlue236WGreen255ARed194H
Blue23
I created a similarity matrix using DAISY and Gower metric and specified
Place and Color columns as characters (
I'm trying to install R 2.15 on an Ubuntu server. I'm getting the "depends
but it's not going to be installed" error messages I've seen people
write about, but never solve. I've attached a screen shot, if that helps.
Has anyone seen (and solved) these updating issues? I find it hard to
beli
I thought my reply went to the group last night. i had already resolved it.
in short, before his first reply it was resolved... which is why i didn't offer
additional information. i was honestly taken aback by his response to me. i
don't respond well to vitriol wrapped in attempts to help. i
So I realized I had to convert my dd.daisy to a matrix and used:
ddmatrix.daisy<-as.matrix(dd.daisy)
and then I passed that in as the distM:
> cutreeDynamic(as.hclust(dd.diana), cutHeight = NULL, minClusterSize = 2,
method = "hybrid", distM = ddmatrix.daisy,deepSplit =
(ifelse(method=="hybrid", 1,
Dear R-users,
I have the following problem: I am running the function 'pvcm' from the 'plm'
Panel Data package. Inside this function 'solve' is called and gives for a
certain individual data series an exception because of singularity. I would
like to know which individual data series causes thi
Hello all,
I would like to do a Dunnett test in glht(). However, the factor level I
want to use as the control is not the first.
dunn1<-glht(model3, linfct = mcp(Container = "Dunnett"), alternative =
"less")
The factor container has 8 levels, so it would be nice not to manually
enter in all o
Hi Arun
I noticed that the values of Fmm, Fnn, and other corresponding variables
are not correct, for example, for the 4th obs after you run this code, the
Fmm is 0.40, but if you use the x, m, y, n in the 4th row to calculate
them, the results are not consistent, same for the 5th obs.
#check
#
Have you queried the value of 'cex' and related parameters at the different
time points?
The help page for par says that when you set mfcol or mfrow that cex is
changed, but I don't know if the layout function also changes those or not.
I would start by peppering your code with calls to par('cex'
thank you!
It seems like the problem was the layout-function automatically changing the
cex parameter for the subplots.
adding par(cex =1) after the layout() call solved it.
Now, character expansion levels seem equal across plots.
On Feb 27, 2013, at 00:57 , Greg Snow <538...@gmail.com> wrote:
On 13-02-26 3:32 AM, Ehsan Masoudi wrote:
Hi all,
My package passed Rcmd check successfully. but
in constructed PDF format of R documentation, within the examples
section, half of the line (R code) is out of the paper. I also found
another CRAN submitted package, ftsa , that suffer from overful
On Feb 26, 2013, at 2:40 AM, José Miguel Delgado wrote:
> Dear R-help,
>
> I wrote the following lines in order to use a variable from a parent frame in
> my callM() function. I would like to solve this by only editing the
> callM(function). When I run this code I obtain a empty list, meaning
I am trying to control the behavior of the SANN method in optim (R
2.14.1) via control$temp. In my toy tests it works; in my real use, it
doesn't.
As far as I can tell my code with different temp values is loaded; I
even traced into the function that calls optim and verified temp had the
value I
This is where <<- is helpful:
> N <- 0 ; trace(solve, quote(N <<- N + 1), print=FALSE)
Tracing function "solve" in package "base"
[1] "solve"
> lapply(3:0, function(i)solve(diag(i,3), 1:3))
Error in solve.default(diag(i, 3), 1:3) :
Lapack routine dgesv: system is exactly singul
Have you looked at the instructions at the URL which Sarah Goslee
drew to the attention of the list on 19 July 2012?
There's a special README for Ubuntu to help you get the current version.
http://cran.r-project.org/bin/linux/ubuntu/README
You probably need to modify your /etc/apt/sources.list
Thanks Arun and David. Another issue I am running into are memory
issues when one of the data frames I'm trying to rbind to or merge
with are "very large". (This is a repetitive problem, as I am trying
to merge/rbind thousands of small dataframes into a single "very
large" dataframe.)
I'm thi
Dear R Users---this is more curiosity than a real problem. I am wondering
how to add mc* functions for all of R's *apply functions. stackoverflow
3505701 has a nice overview of these functions. roughly,
apply ( function to rows and columns of matrix )
lapply ( function to each element of list,
merge and rbind have very different memory usage profiles. There are some
optimizations you can take advantage of if you store all of your small data
frames in a list first, and then feed it through sapply (base) or ldply (plyr)
to form the large data frame all at once, which can avoid the memor
HI,
#
Pm2<-rbeta(1000, 0.2+1, 0.8+3) #obs4
length(Pm2)
#[1] 1000
Pn2<-rbeta(1000, 0.2, 0.8+4)
length(Pn2)
#[1] 1000
Here, you are creating Pm2 or Pn2 from a single observation.
In the code, it is creating 1000 values in total from the combination of values
from x, m,
Pm2<-rbeta(1000, 0.2+re
On Feb 26, 2013, at 9:33 PM, Anika Masters wrote:
> Thanks Arun and David. Another issue I am running into are memory
> issues when one of the data frames I'm trying to rbind to or merge
> with are "very large". (This is a repetitive problem, as I am trying
> to merge/rbind thousands of small
> HI,
> #
> Pm2<-rbeta(1000, 0.2+1, 0.8+3) #obs4
> length(Pm2)
> #[1] 1000
>
>
> Pn2<-rbeta(1000, 0.2, 0.8+4)
> length(Pn2)
> #[1] 1000
> Here, you are creating Pm2 or Pn2 from a single observation.
>
> In the code, it is creating 1000 values in total from the combination of
> values from x, m,
>
The values of 'x' an 'm' from res2. For more information, you can check ?rbeta.
I also don't get what you are up to.
If you want to create 1000 random samples for each combinations of x, m
lapply(lapply(unique(apply(cbind(res2$x,res2$m),1,paste,collapse="")),function(i)
as.numeric(unlist(strspl
When running irlba on a big.matrix as in the example from the vignette (on
Windows R 2.15.2 64 bit) it returns with an error (see below). irlba works
fine on a regular R matrix
> library(bigalgebra)
> library(irlba)
Loading required package: Matrix
Loading required package: lattice
> matmul <-
Thanks Rui,
It is very useful indeed.
Bests,
Niklas
2013/2/26 Rui Barradas
> Hello,
>
> I'm not sure I understand, do you want to treat BCC, CBC and CCB as the
> same? If so try
>
> w2 <- apply( y , 1 , function(x) paste0(sort(x) , collapse = "" ))
>
> table(w2)
>
>
> Hope this helps,
>
> Rui Ba
Hi
can not resist
Var001 <- (NAM>=7 & NAM<=9)*1
Regards
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Tasnuva Tabassum
> Sent: Tuesday, February 26, 2013 7:03 PM
> To: Berend Hasselman
> Cc: R help
> Subject: Re: [R]
On Tue, Feb 26, 2013 at 8:34 AM, Joanna Papakonstantinou
wrote:
> So I realized I had to convert my dd.daisy to a matrix and used:
> ddmatrix.daisy<-as.matrix(dd.daisy)
> and then I passed that in as the distM:
>> cutreeDynamic(as.hclust(dd.diana), cutHeight = NULL, minClusterSize = 2,
> method =
Hi,
I'm using metafor to perform a mixed-effects meta-analysis. I'd like to
test whether the effect is different for animals and plants/whether "group"
(animal/plant) influences the effect size, but am having trouble
interpreting the results I get. I've read previous posts about QM in
metafor, but
res2<- join(res1,d3,by=c("m1","n1"),type="inner")
p0L<-0.05
p0H<-0.05
p1L<-0.20
p1H<-0.20
res2<- within(res2,{p1<- x/m; p2<- y/n;term2_p0<-dbinom(x1,m1, p0L, log=FALSE)*
dbinom(y1,n1,p0H, log=FALSE)*dbinom(x-x1,m-m1, p0L, log=FALSE)*
dbinom(y-y1,n-n1,p0H, log=FALSE);term2_p1<- dbinom(x1,m1
77 matches
Mail list logo