Hi Jon,
Saving your workspace doesn't mean that everything will be rerun when
you start a new R session. I just means that persistent objects like
data frames will be there. If you type:
objects()
you will see all of those things that were there when you ended in the
last session. Things like com
Hi Alex,
This is harder than it looks for a number of reasons. First you want
to desaturate the colors as you move out, which requires something
more sophisticated than the approximation I have done in the code
below. RGB may not be the best colorspace to use for this. Second is
that when you draw
Well, scatterplot3d might not allow it, but have a look at the second
example for staxlab in the plotrix package.
Jim
On Wed, Nov 1, 2017 at 7:30 AM, Uwe Ligges
wrote:
>
>
> On 31.10.2017 00:56, Alex Restrepo wrote:
> ...
> 45 degree rotation is not supported in base R graphics and scatterplot3d
Or if you want a slightly prettier output:
formatDate<-function(x) {
return(paste(x$year,formatC(x$month,width=2,flag=0),
formatC(x$day,width=2,flag=0),sep="-"))
}
formatDate(p.dates)
Jim
On Thu, Nov 9, 2017 at 10:32 AM, David L Carlson wrote:
> How about
>
>> p_dates <- paste0(p.dates[[3]],
Hi Javad,
You can place text using the "text" function or for a slightly fancier
label, try boxed.labels in the plotrix package.
Jim
On Mon, Nov 13, 2017 at 5:04 PM, Javad Bayat via R-help
wrote:
> I have a shapefile point and I plot it over my polygon. Is it possible to
> label station names
Hi Ruiyang,
I think you want "get":
For (index in seq(1,16)){
plot(x=(a given set of value),y=get(paste(“PC”,as.character(index),sep=“”)))
}
On Wed, Nov 15, 2017 at 7:43 AM, 刘瑞阳 wrote:
> Hi,
> Suppose that I want to do a series of plots with the y value for each plot as
> PC1, PC2, PC3… How cou
y because x is simply a name instead of a
> data.frame variable(Error: "attempt to set 'rownames' on an object with no
> dimensions"). But I could not find the right way out… How should I solve it?
>
> Thanks!
>
> Ruiyang
>
>
>> On Nov 14, 201
Hi Elham,
The error message is pretty explicit. Check your dataset for missing values.
Jim
On Thu, Nov 23, 2017 at 6:14 AM, Elham Fakharizade via R-help
wrote:
>
> Hello DearI used modifiedmk package for trend analyses.this is my script
> require(modifiedmk)X1<-read.table("c:/elham/first
> ar
ow can I search for missing value?
> Sincerely yours
> Elham
>
> Elham Fakharizadeshirazi.
>
> Doctoral guest researcher in Institute of Meteorology,
>
> Department of Earth Sciences,
>
> Free university of Berlin,
>
> Berlin, Germany.
>
>
>
> On
Hi Engin,
Sadly, your illustration was ambushed on the way to the list. Perhaps
you want something like this:
# proportion of useful answers to your request
pua<-sort(runif(20))
#legibility of your request
lor<-sort(runif(20))+runif(20,-0.5,0.5)
# is a data set provided?
dsp<-sort(runif(20))+runif
Hi Robert,
People want different levels of automation in the software they use.
What concerns many of us is the desire for the function
"figure-out-what-this-data-is-import-it-and-get-rid-of-bad-values".
Such users typically want something that justifies its use by being
written by someone who seem
Hi again,
Typo in the last email. Should read "about 40 standard deviations".
Jim
On Thu, Nov 30, 2017 at 10:54 AM, Jim Lemon wrote:
> Hi Robert,
> People want different levels of automation in the software they use.
> What concerns many of us is the desire for the function
Hi SAS_learner,
Have a look at the read.xport function in the foreign package.
Jim
On Fri, Dec 1, 2017 at 7:50 AM, SAS_learner wrote:
> Hello all ,
>
> I am a SAS user for a while and wanted to learn to program in R . My
> biggest hurdle to start, is to get the data (I work in clinical domain
>
Hi Sergio,
You seem to be aiming for a univariate repeated measures analysis.
Maybe this will help:
subno<-rep(1:6,2)
dat <- data.frame(subno=rep(1:6,2),,vals = c(ctrl, ttd),
cond = c(rep("ctrl", 6), rep("ttd", 6)), ind = factor(rep(1:6, 2)))
fit<-aov(vals~ind+cond+Error(subno),data=dat)
fit
su
Hi Abou,
Without an illustration it's hard to work out what you want. here is a
simple example of two circles using semi-transparency. Is this any
help?
pdf("circles.pdf")
plot(0:10,type="n",axes=FALSE,xlab="",ylab="")
draw.circle(4,5,radius=3,border="#ffaa",lwd=10)
draw.circle(6,5,radius=3,bo
*
>
> *Department of Mathematics and Statistics*
> *University of Southern Maine*
>
>
> On Sun, Dec 31, 2017 at 8:40 AM, Marc Girondot via R-help <
> r-help@r-project.org> wrote:
>
>> Another solution:
>>
>> library("HelpersMG") plot(0:10,type
Hi Sibylle,
I might have the wrong idea, but does this:
hecke<-matrix(sample(1:40,104,TRUE),nrow=2)
library(plotrix)
barp(hecke,col=c("lightblue","pink"))
legend(43,40,c("M","F"),fill=c("lightblue","pink"))
do what you want? It is also possible to display this as a nested bar
plot showing males a
Hi Kenneth,
I don't know about ggplot, but perhaps this will help:
kddf<-read.table(text="city n y
mon 100 200
tor 209 300
edm 98 87
mon 20 76
tor 50 96
edm 62 27",
header=TRUE,stringsAsFactors=FALSE)
library(plotrix)
barpos<-barp(t(kddf[,2:3]),names.arg=kddf[,1],xlab="City",ylab="Sum",
main="Sum
Hi Gavin,
Here's a sort of brute force way to nudge points. Might be helpful.
nudge<-function(x,y,away=0.1,tol=0.01) {
dimx<-dim(x)
if(missing(y) && !is.null(dimx)) {
y<-x[,2]
x<-x[,1]
}
xlen<-length(x)
if(xlen != length(y)) stop("x and y must be the same length.")
for(i in 1:xlen) {
f
Hi Ogbos,
You can just use ISOdate. If you pass more values, it will process them:
ISOdate(2018,01,22)
[1] "2018-01-22 12:00:00 GMT"
> ISOdate(2018,01,22,18,17)
[1] "2018-01-22 18:17:00 GMT"
Add something like:
if(is.null(data$hour),data$hour<-12
then pass data$hour as it will default to the sa
Hi Ace,
You can do it with plotrix:
library(plotrix)
barpos<-barp(c(1,5,38),width=0.5,col=c("white","lightgray","darkgray"),ylim=c(0,70))
ehplot(c(1,0.8,0.9,0.8,1.1,1,4,3,5,14,3,2,32,27,33,30,50,61),
c(1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3),median=FALSE,add=TRUE,cex=2,
pch=21,bg="white")
dispersio
Hi Dennis,
How about:
# define the two values to search for
x<-2
y<-3
# create your search string and replacement string
repstring<-paste(x,y,sep=",")
newstring<-paste(x,y,sep=".")
# this is the string that you want to change
thetastring<-"SIGMA(2,3)"
sub(repstring,newstring,thetastring)
[1] "SIG
Hi Val,
Try this:
preval<-data.frame(Col1=unique(unlist(mydat[,c("Col2","col3")]))[-1],
Col2=NA,col3=NA)
rbind(preval,mydat)
Jim
On Sat, Feb 24, 2018 at 3:34 PM, Val wrote:
> Hi All,
>
> I am reading a file as follow,
>
> mydat <- read.table(textConnection("Col1 Col2 col3
> Z2 NA NA
> Z3 X1 NA
>>>> altered x1 is what you want.
>>>>
>>>> You asked why x2 was zero. The value of the expression
>>>> f(a) <- b
>>>> and assignments are processed right to left so
>>>> x2 <- x[!is.na(x1)] <- 0
>>>&g
I could not find K1 in col1.
>
> rbind(preval,mydat)
> Col1 Col2 col3
> 1
> 2 X1
> 3 Y1
> 4 K2
> 5 W1
> 6 Z1 K1 K2
> 7 Z2
> 8 Z3 X1
> 9 Z4 Y1 W1
>
>
>
> On Sat, Feb 24, 2018 at 6:18 PM, Jim Lemon wrote:
>
Hi Allaisone,
If you want a data frame as the output you will have to put up with a
few NA values unless each Customer has the same number of diet types:
a1df<-read.table(text="CustomerIDDietType
1 a
1c
1b
2
Hi Herry,
This is probably due to a call to strptime (or similar). No, it
doesn't accept %Y-%m as a valid format. Maybe add a constant day to
all the dates as that will work:
dt<-list(ID=seq(1:24),month=rep(formatC(1:12,flag=0,width=2),2),
year=sort(rep(2016:2017,12)))
timelst<-paste(unlist(dt['y
I can't test that at the moment as I don't have the libraries. Perhaps later.
Jim
On Tue, Mar 6, 2018 at 11:36 AM, wrote:
> Last line in the following (updated) code produces the error
> require(raster)
> require(rts)
> require(stringr)
> r <- raster(ncol=100, nrow=100)
> values(r) <- runif(nce
Hi Faiz,
Just to add to the confusion:
library(prettyR)
describe(iris)
You can specify which summary measures you want in the "num.desc" argument.
Jim
On Tue, Mar 6, 2018 at 11:03 PM, faiz rasool wrote:
> Dear list, I have the following how-to-do it in R, questions.
>
> Suppose I have ten inde
Hi Christofer,
You may be looking for ecdf (stats) for a start, then working out a
way to translate the cumulative density values into probability
values.
Jim
On Mon, Mar 12, 2018 at 5:45 AM, Christofer Bogaso
wrote:
> Hi,
>
> Let say I have below vector of data-points :
>
> Dat = c(-0.
Hi Neha,
This might help:
R<-read.table(text="C1 C2 C3 C4
R1 0 1 0 1
R2 1 0 1 1
R3 1 0 0 0",
header=TRUE)
U<-read.table(text="C1 C2 C3 C4
U1 1 1 0 1
U2 1 1 1 1",
header=TRUE)
# these are matrices - I think this will work for dataframes as well
for(ui in 1:dim(U)[1]) {
for(ri in 1:dim(R)[1]) {
i
Hi Willy,
The error message may be due to passing an inappropriate environment.
I don't have the "erer" package, but if that function has a default
for the environment argument, perhaps passing just the "predvars" and
"data" arguments will work.
Jim
On Tue, Mar 20, 2018 at 8:24 AM, Willy Byamungu
e effect.Somehow_reliable
> effect.Very reliable
> Adopt -0.073 -0.057
> -0.0640.193
> Training-0.283 -0.135
> -0.0510.469
>
>
> On Mon, Mar 19, 2018 at 6:46 PM, Jim Lemon wro
Hi Neha,
>From your message I think that you might get what you want with:
names(df)<-unlist(B)
However, the "sets" package might handle lists differently.
Jim
On Tue, Mar 20, 2018 at 2:24 PM, Neha Aggarwal
wrote:
> Hello all,
>
> I have a set B and a dataframe df. I want to name the columns o
Hi Marna,
Assuming that you are descending into different subdirectories from
the same directory:
directories<-c("dir1","dir2","dir3")
for(directory in directories) {
setwd(directory)
# do whatever you want to do
# then return to the directory above
setwd("..")
}
This will allow you to start
Hi Mohammad,
The plot you attached suggests that the underlying distribution may be
a mixture. Is there anything in your data that would explain this,
such as laden/unladen, uphill/downhill, different road surface?
Jim
On Mon, Apr 16, 2018 at 11:31 PM, Mohammad Areida wrote:
> Hi, I do not know
It's happened 3 or 4 times for me, only on the R list. It only happens
when answering certain questions and I think all responders to that
question may get it. Seems to have nothing to do with the OP. I just
block the email address.
Jim
On Wed, Apr 18, 2018 at 1:33 PM, Mark Leeds wrote:
> Hi All
Hi Farnoosh,
Perhaps this will help:
drop_dollar<-function(x) return(as.numeric(as.character(gsub("\\$","",x
sapply(My.Data,drop_dollar)
Jim
On Thu, Apr 19, 2018 at 7:23 AM, Farnoosh Sheikhi via R-help
wrote:
> Hello,
> I have a data frame with 400 columns and wanted to filter character col
Hi Neha,
How about this?
find_subset<-function(x,y) {
yrows<-dim(y)[1]
match<-0
for(row in 1:yrows) match<-sum(x&y[row]) >= sum(y[row])
return(match)
}
apply(B,1,find_subset,A)
This is somewhat obscure, as the dataframe B is coerced to a matrix by
the apply function.
Jim
On Sat, Apr 21, 201
Hi bbb_aaa,
The format for the input to the function (gantt.info) is a list. As
Sarah mentions, a data frame is a list, so as long as your columns
have the right names and are in the correct order, it should work. As
you probably know, you can import a CSV file into R as a data frame
using read.csv
Hi Miluji,
You have a problem as the x-axis is different for the two plots.
However, the y-axis can be the same, so you really don't need
different axes. I think you want to display city within week. The
example below shows how to display both the counts for the cities by
week, the mean z by week a
Hi Marna,
Try this:
library(prettyR)
stretch_df(dat,idvar="ID",to.stretch=c("EventDate","SITE"))
Jim
On Wed, May 2, 2018 at 8:24 AM, Marna Wagley wrote:
> Hi R user,
> I was trying to convert a long matrix to wide? I have an example and would
> like to get a table (FinalData1):
>
>
> FinalData
TE"))
>
>
> ID timeGroup EventDate_1 EventDate_2 EventDate_3 SITE_1 SITE_2 SITE_3
> 1 id_XB1 9/8/16 9/9/16 9/15/17 A A B
> 2 id_YB1 9/7/16 9/15/16 A B
>>
>
> Basically I am looking for like
lData1
>
> B1B2
> id_X "A" "B"
> id_Y "A" "B"
>
> thanks,
>
>
>
> On Tue, May 1, 2018 at 4:05 PM, Jim Lemon wrote:
>>
>> Hi Marna,
>> I think this is due to having three rows for id_X and onl
Hi Greg,
What you are getting there is a factor, interpreted as a 1:n sequence
based on the sort order of your "dates". Here's a way to get dates on
your x-axis in the format you want:
x_mmdd<-as.Date(c("2018-04-25","2018-04-26","2018-04-27",
"2018-04-28","2018-04-29","2018-04-30","2018-05-01
official R 3.5.0 for Mac OS X.
> This apparently does not include library (plotrix)
>
> library(plotrix)
> Error in library(plotrix) : there is no package called ‘plotrix’
>
> Greg
>
> On May 5, 2018, at 6:50 PM, Jim Lemon wrote:
>
> Hi Greg,
> What you are getting
Hi Greg,
By default, the "axis" function puts the labels on one line and drops
labels that would overlap. When you have labels that are all the same
length, this usually results in every second, or third, or fourth
label being displayed. So you can probably get what you want by not
using staxlab. H
ype="l", xaxt="n", yaxt="n",
> ylim=range(240,480))
> abline (h=c(240,270,300,330,360,390,420,450,480,510,540), lty=2, lwd=1.0,
> col="grey40")
> axis (side=2, at=240, cex.axis=1.0, label="4:00")
> axis (side=2, at=300, cex.a
yymmdd,"%Y-%m-%d"))
>
> How do I get the text for -MM-DD to be drawn vertically, instead of
> horizontally?
> Greg
>
> On May 6, 2018, at 11:54 PM, Jim Lemon wrote:
>
> axis(1,at=x_mmdd,labels=format(x_mmdd,"%Y-%m-%d"))
>
>
___
Hi Greg,
This is because both plots have equally spaced x values. To see the
difference, try this:
plot (x_mmdd, y_duration, type="l", xaxt="n", yaxt="n",
ylim=range(240,480), xlab="", ylab="", col="blue")
axis(1)
plot (y_duration, type="l", xaxt="n", yaxt="n",
ylim=range(240,480),
Hi Franklin,
plot.dendrite was not designed to be pruned. I have had a look at the
problem, and I may be able to suggest a way to drop values in the
"dendrite" object that is the input to plot.dendrite. I'll let you
know.
Jim
On Tue, May 8, 2018 at 11:46 PM, Franklin Mairura via R-help
wrote:
>
Hi Shakeel,
Assuming that you are starting with a bunch of dates:
# make a vector of character strings that can be converted to dates
rep_dates<-paste(sample(1:30,500,TRUE),sample(1:12,500,TRUE),
sample(2013:2017,500,TRUE),sep="/")
# if this isn't your format, change it
date_format<-"%d/%m/%Y"
#
Hi Jayaganesh,
I'm not sure this will help, but here is a simple example using box.heresy:
y_duration <- c (16.438, 15.321, 12.700, 12.397, 10.795, 9.928, 10.386)
library(plotrix)
box.heresy(1,mean(y_duration),uinner=std.error(y_duration)
,ulim=sd(y_duration),intervals=TRUE)
#add the median as a
Hi lily,
There are one or two assumptions to be made here. First is that the
latitude and longitude values of the "black" cells are equally spaced
as in your illustration. Second, that all latitude and longitude
values for the "red" cells fall at the corners of four "black" cells.
You can get the
Hi Val,
This may help:
tdat$allpresent<-FALSE
for(state in allstates)
tdat$allpresent[tdat$stat == state]<-
all(allyears %in% tdat$year[tdat$stat==state])
tdat2<-tdat[tdat$allpresent,]
xtabs(Y~stat+year,tdat2)
table(tdat2$stat,tdat2$year)
Jim
On Fri, May 18, 2018 at 10:48 AM, Val wrote:
> H
Hi Ilio,
As far as I can see, this is what you have done:
A<-data.frame(V1="Year",V2=1992,V3=1993)
B<-data.frame(V1=c("Year","18-19"),V2=c("Average (cm)",178.3),
V3=c("N",6309),V4=c("SD",6.39))
A
V1 V2 V3
1 Year 1992 1993
B
V1 V2 V3 V4
1 Year Average (cm)N SD
2 1
]$lon-redcell$lon) < 1) {
> close4[closen]<-i
> closen<-closen+1
> }
> }
>
> On Wed, May 16, 2018 at 2:45 AM, Jim Lemon wrote:
>>
>> Hi lily,
>> There are one or two assumptions to be made here. First is that the
>> latitude and longitude val
Hi lily,
It's not too hard to do it using dataframes. Getting the indexing
right is usually that hardest part:
# these values are the centers of the black cells
lat<-rep(28:38,11)
lon<-rep(98:108,each=11)
pop<-sample(80:200,121)
# just use the data.frame function
blackcells<-data.frame(lat=lat,lon
Hi Steven,
Sad to say that your CSV file didn't make it to the list and I can't
access the data via your Dropbox account. Therefore we don't know the
structure of "mydata". If you are able to plot the data as in your
example, this might help:
genexp<-matrix(runif(360,1,2),ncol=18)
colnames(genexp)
ott like attached but the Y axis starts in XIV and
>> end at top in I. Generally for instance in excel X axis is categories but Y
>> axis is numbers I want the contrary plotted in lines, your last help is near
>> what I look but barplot is not needed.
>>
>> Hope you c
Hi lili,
You can extend it like this. I checked this with two values each for
pop and mood, and it looked okay. Obviously I didn't check the result
with 365 values for each, but it ran okay.
# these values are the centers of the black cells
lat<-rep(28:38,11)
lon<-rep(98:108,each=11)
pop<-matrix(s
Hi Faradj,
What a problem! I think I have worked it out, but only because the
result is the one you said you wanted.
# the sample data frame is named fkdf
Y2Xby3<-function(x) {
nrows<-dim(x)[1]
X<-rep(0,nrows)
for(i in 1:(nrows-2)) {
if(!is.na(x$Y[i])) {
if(x$Y[i] == 1 && any(is.na(x$Y[(i+
d twice in the data (e.g.
> USSR Yugoslavia etc).
>
> Best,
> Faradj
>
>
> 29 maj 2018 kl. 02:15 skrev Jim Lemon :
>
> Hi Faradj,
> What a problem! I think I have worked it out, but only because the
> result is the one you said you wanted.
>
> # the sample data fr
Hi Joshua,
Because there are no values in column ddd less than 1.
itemInfo[3,"ddd"]<-0.3645372
itemInfo
aaa bbb ccc dddeee
skill 1.396 6.225 0.517 5.775 2.497
predict 1.326 5.230 0.462 5.116 -2.673
waiting 1.117 4.948NA 0.365 NA
complex 1.237 4.170 0.220 4.
Hi Christian,
When I have to do something like this, I usually write it in
Postscript using this:
/def mm 2.8346 mul
that converts a dimension in mm to points (1/72 inch). However, this
won't work in R. It may be possible to set up the device like this:
postscript("myfile.ps",paper="a4")
par(mar
5,95),c(95,145,95,45),
c(95,145,95,45),c(145,95,45,95))
box()
dev.off()
Jim
On Thu, Jun 7, 2018 at 8:16 AM, Jim Lemon wrote:
> Hi Christian,
> When I have to do something like this, I usually write it in
> Postscript using this:
>
> /def mm 2.8346 mul
>
> that converts a
Hi Jeff,
jrdf<-data.frame(A=rnorm(10),B=rnorm(10),C=rnorm(10),
D=rnorm(10),E=rnorm(10),F=rnorm(10),G=rnorm(10),
H=rnorm(10),I=rnorm(10),J=rnorm(10))
for(i in c(2,7,8,9)) jrdf[,i]<-factor(jrdf[,i])
sapply(jrdf,"class")
Jim
On Tue, Jun 12, 2018 at 9:57 AM, Jeff Reichman wrote:
> R-Help Forum
>
Hi Bill,
It may be that the NonAcceptanceOther, being a character value, has ""
(0 length string) rather than NA. You can convert that to NA like
this:
df2$NonAcceptanceOther[nchar(df2$NonAcceptanceOther) == 0]<-NA
Jim
On Thu, Jun 14, 2018 at 12:47 AM, Bill Poling wrote:
> Good morning.
>
> #I
Hi Ogbos,
This may help:
# assume your data frame is named "oodf"
oomean<-as.vector(by(oodf$B,oodf$A,mean))
oose<-as.vector(by(oodf$B,oodf$A,std.error))
plot(-5:10,oomean,type="b",ylim=c(5,11),
xlab="days (epoch is the day of Fd)",ylab="strikes/km2/day")
dispersion(-5:10,oomean,oose)
Jim
> And the error says:
> Error in FUN(X[[1L]], ...) : could not find function "FUN"
>
> Please note that I use:
> std.error = sd(B)/sqrt(sum(!is.na(B)))
> to calculate the standard error as it requested for it.
>
> Thanks
> Ogbos
>
> On Sat, Jun 23, 2018 at
Hi Ogbos,
The problem is almost certainly with the data. I get the plot I expect
with the sample data that you first posted, so I know that the code
works. If you try thIs what do you get?
oodf<-read.table(text="S/N AB
1-5 64833
2-4 95864
3-3 82322
4-2 95591
5-
Hi Simon,
Easy to do if you call "print" directly:
print<-function(x) cat(deparse(substitute(x)),"=\n",x,"\n")
y<-3
print(y)
y =
3
Obviously you will want to get rid of your print function when it is
not being used with "rm" or by starting a new session. Getting it to
bypass the default print me
Hi Abou,
You can't display an axis if it is not in the range of the plot. I
think you want:
plot(0,type="n",yaxs="i",xaxs="i",xaxt="n",yaxt="n",xlim=c(15,85),
ylim=c(300,600),xlab="Age",ylab="Distance (ft)",cex.lab=1.5)
grid(nx = 10, ny = 10, col = "lightgray", lty = "dotted", lwd = 2)
xticks <-
Hi Nick,
You are probably using Windows, for which the maximum path length is
claimed to be 260 characters. The most common alternative, Linux, has
a maximum filename length of 255 and a maximum path length of 4096. If
you are simply writing a file to the current path, it won't make much
difference
Hi Kelly,
You seem to be testing the two "years" independently, so here is a
possible solution:
npg<-16
futility1<-futility2<-psignif1<-psignif2<-nrep<-0
while(!futility1 && !futility2 && !psignif1 && !psignif2 && nrep < 1) {
control_respond1<-sum(runif(npg,0,1) < 0.05)
control_respond2<-sum
Hi Adam,
Looks like you have a matrix or data frame and want to change one or
more observations to NA. I think this will do the trick:
# assume the matrix or data frame is named "ajdat"
randomNA<-function(x,nNA=1) {
dimx<-dim(x)
x[sample(1:dimx[1],nNA),sample(1:dimx[2],nNA)]<-NA
return(x)
}
So
Hi Laura,
Here's a basic method:
lsdf<-read.table(text="Bird Date Latitude Longitude
eb80976 16/07/2012 50.99 -5.85
eb80976 17/07/2012 52.09 -4.58
eb80976 18/07/2012 49.72 -5.56
eb80976 19/07/2012 51.59 -3.17
eb80976 20/07/2012 52.45 -2.03
eb80976 21/07/2012
Hi Nell,
I may not have the right idea about this, but I think you need to do
this in two steps if it can be done. Let's say you want a sequence of
20 (N) numbers between 0 and 10 that sums to 10 (M). You can enumerate
the monotonically increasing sequences like this:
c(0,0,0,0,0,0,0,0,0,0,1,1,1,1
gt; rp <- crank::permute(r[[sample(1:length(r), 1)]])
> rp[sample(1:dim(rp)[1],1),]
>
> In this case, Is it correct to permute the elements of a vector rather than
> to permute a vector ?
>
>
> Many thanks for your time.
>
> Have a nice day
>
> Nell
>
>
&g
Hi Bogdan,
There seem to be three problems. One is that if you want a logarithmic
x axis you shouldn't have a zero (or a negative number) in your data.
The second is that you have to ask for a logarithmic axis. The third
is that you have limited your x axis to less than the range of the
data in "b"
Hi Frederic,
You are asking for the sum of cases in the months September to
December for the years 2012 to 2017. I get a plot that shows that
from:
plot(busoro[,"X"],busoro[,"Sep"] + busoro[,"Oct"] + busoro [,"Nov"] +
busoro[,"Dec"],type="b",ylab="Malaria Cases",xlab="Year")
What sort of plot wer
Hi Francesca,
This looks like a fairly simple task. Try this:
fpdf<-read.table(text="PASP SUBJC
0 0
4 1
0 0
8 0
4 0
0 1
0 1",
header=TRUE)
# get the number of positive PASP results by group
ppos<-by(fpdf$SUBJC,fpdf$PASPpos,su
Hi again,
Sorry, forgot this line:
fpdf$PASPpos<-fpdf$PASP > 0
just after reading in the data frame.
Jim
On Thu, Jul 19, 2018 at 9:04 AM, Jim Lemon wrote:
> Hi Francesca,
> This looks like a fairly simple task. Try this:
>
> fpdf<-read.table(text="PASP
Hi Serena,
I think the directory structure you have described is something like this:
mov_study___
| |
mov1 ...mov9
/ \
Hi Davide,
The error message is probably due to a zero length dimension in:
W[,ind.positives]
I would look at W (data frame?) to see where this might occur. That
is, does W have a set of proteins with _no_ annotations? Perhaps
manually removing that set will get the function running.
Jim
On We
Hi Ruchika,
Maybe the hdeco package will help.
Jim
On Wed, Apr 5, 2017 at 2:28 PM, Ruchika Salwan
wrote:
> Hey,
>
> Is there any package in R that handles graph decomposition? A package
> created specifically for flat/hierarchical decomposition of graphs.
>
> Thanks,
>
> [[alternative H
Hi Pateek,
Try this:
ppdat<-read.table(text="Values Churn
21 1
22 1
31.2 1
32 1
35 0
43 1
45 0
67 1
67 0
76 0
89 1",
header=TRUE)
ppdat$Valbin<-cut(ppdat$Values,breaks=c(20.9,43.7,66.3,89
Hi Prateek,
There is some difficulty with including the empty categories in the
factors generated. I couldn't get these even with drop=FALSE, so I had
to go through the "xtab" function. You can do it with the "table"
function in the base package, but it is a little more trouble. See if
this is what
Hi Sanjeev,
The video that you attached seems to contain the information that you
want. If you contact Kazi Rahman (the creator of the video) who seems
to be at the University of Geneva currently, you may be able to get
the information that you want.
Jim
On Wed, Apr 26, 2017 at 4:27 PM, Sanjeev K
Hi Dhivya,
I'm not that familiar with the "gg.ts" function, but you are passing
character values to the "frequency" and "start" arguments. If there is
no automatic conversion to numeric values, that would cause the error.
Similarly, your "timestamps" variable may have been read in as a
factor, whic
Hi Bianca,
Try this:
gap.barplot(c(mean(SA),mean(AA),mean(CA)),
gap=c(1,250),xlim=c(0.5,3.5),xaxlab=c("SA","AA","CA"),
ytics=c(0,255,260,265),yaxlab=c(0,255,260,265))
barlabels(1:3,c(5,5,5),
paste(c(mean(SA),mean(AA),mean(CA)),
round(c(sd(SA),sd(AA),sd(CA)),3)))
It's a bit rough, but I don't
Hi Miguel,
You don't seem to have defined "J" before line 2. Maybe that is the problem.
Jim
On Mon, May 1, 2017 at 2:57 PM, Miguel Angel Hombrados Herrera
wrote:
> Hello
>
>
> Ive been working on a stan program in Rstudio. Im kind of new on this, so
> probably my question is trivial, However I
Hi Michael,
The arctext function (plotrix) does something similar, and the code
could be modified to do what you request. If you do want a working
function, it wouldn't be too hard to program.
Jim
On Tue, May 2, 2017 at 6:57 AM, Michael Hannon
wrote:
> Hi, folks. This is an issue that we've de
Hi Ek,
I think you want your example to look like this:
Sample<-read.table(text=
"Num Color Grade Value Month Day
1 yellow A 20 May 1
2 green B 25 June 2
3 green A 10 April 3
4 black A 17 August 3
5 red C 5 December 5
6 orange D 0 January 13
7 orange E 12 January 5
8 orange F 11 February 8
9 orang
Hi Davide,
You wouldn't be dealing with the Stroop test, would you?
stroop.df<-data.frame(subject=rep(paste("S",1:10,sep=""),each=12),
color=rep(c("R","G","B"),40),cong=rep(rep(c("C","I"),each=3),20))
stroop.df$colcong<-paste(stroop.df$color,stroop.df$cong,sep="")
stroop.rc<-stroop.df[stroop.df$c
Hi Thambu (David?),
While I like the misspelling of CRAN (there is a lot CRAMmed on it),
could this be your problem?
Jim
On Thu, May 4, 2017 at 12:55 AM, thambu david via R-help
wrote:
> Dear AllI am learning R commander and have un-installed my earlier version of
> R and installed the 3.4 vers
Hi Antonio,
Have a look at twoord.plot (plotrix). It may make your repeated plots easier.
Jim
On Sun, May 7, 2017 at 7:50 AM, Antonio Silva wrote:
> Hello
>
> I want to make a plot with two "y" axes. The labels at axis 4 should be the
> values from axis 2 multiplied by a scale factor (as 3.5).
Hi Ante,
As this is a homework problem, you will probably get a number of
negative replies. You might want to look at the color.scale.lines
function in the plotrix package. Perhaps you will find some clues in
the code.
Jim
On Mon, May 8, 2017 at 9:22 AM, Ante Dilber wrote:
> So I have the follow
Hi Kristi,
It can be done, but it is messy:
pl = data.frame(Time = 0:10, menle = rnorm(11))
pl$menlelb = pl$menle -1
pl$menleub = pl$menle +1
rg<-0.95
blue<-1
plot(pl$Time,pl$menlelb,ylim=range(c(pl$menlelb,pl$menleub)),type="l",
lwd=7,col=rgb(rg,rg,blue))
lines(pl$Time,pl$menlelb,lwd=7,col=rgb(r
Hi Antonio,
First you want the center of the plot:
xylim<-par("usr")
x_center<-sum(xylim[1:2])/2
Then as you want to have you legend above the plot:
# you will probably want to change the "20" to your preference
y_bottom<-xylim[4]+diff(xylim[3:4])/20
then:
legend(x_center,ybottom,...xjust=0.5,
1 - 100 of 3432 matches
Mail list logo