;01.01.2011","%d.%m.%Y")),
datframe$changepoint[1:2],
as.POSIXct(strptime("24.01.2011","%d.%m.%Y")),
datframe$changepoint[4:5]),
ends=datframe$changepoint)
gantt.chart(tm.info,
xlim=as.POSIXct(strptime(c("1.1.2011","10.3.2011"),"%d.%m.%Y
Hi Greg,
What is happening is easy to see:
ph<-matrix(sample(1:100,40),ncol=4)
colnames(ph)<-c("M1","X1","X2","X3")
ph[sample(1:10,3),1]<-NA
ph
M1 X1 X2 X3
[1,] 34 98 3 35
[2,] 13 66 74 68
[3,] NA 22 99 79
[4,] 94 6 80 36
[5,] 18 9 16 65
[6,] NA 29 56 90
[7,] 41 23 7
Hi Paul,
The easy to understand way is:
n <- c(1:10)
# Create empty list to store vectors
list_of_vecs <- list()
# Create n vectors of random numbers - length 10. This works ok.
for (i in n){
list_of_vecs[[i]]<-rnorm(10,0,1)
}
If you really want to use "assign":
for (i in n){
Hi Dagmar,
I think you want something like a gantt.chart. I know this is wrong in
some ways, but it is late and I must retire:
datframe <- data.frame(Name=c("Kati","Kati","Kati","Leon","Leon","Leon"),
changepoint=as.Date(c("03.01.2011","05.01.2011", "27.01.2011",
"26.01.2011","28.01.2011",
Hi Maria,
Perhaps something like this:
mldf<-read.table(text="Sample Cu Zn Mn
M1 1 5 10
M2 2.5 11 8
M3 1.15 11 12
M4 2 4 30
M5 8 15 35",
header=TRUE)
matplot(mldf,type="b",pch=c("C","Z","M"))
Jim
On Mon, Dec 5, 2016 at 11:25 PM, Maria Lathouri via R-help
Hang on, maybe you mean something like this:
erupt_dens<-density(faithful$eruptions)
plot(erupt_dens,ylim=c(0,0.65))
dispersion(erupt_dens$x,erupt_dens$y,ulim=erupt_dens$y/5,
type="l",fill="lightgray",interval=TRUE)
lines(erupt_dens)
Jim
On Fri, Dec 2, 2016 at 9:36
s - a polygon
> inserted into my density plot (and not a confidence line along a scatter
> plot like your suggested solution)
>
> My x-axis is an index (a data frame), my y-axis is the automatically
> constructed density
>
> On Fri, Dec 2, 2016 at 10:01 AM, Jim Lemon <drj
Hi Elysa,
I think you are going a bit off course in your example. Try this and
see if it is close to what you want:
data<-rnorm(100)+runif(100,0,15)
smu_data<-supsmu(1:100,data)
rollfun<-function(x,window=10,FUN=sd) {
xlen<-length(x)
xout<-NA
forward<-window%/%2
backward<-window-forward
On Fri, Dec 2, 2016 at 7:58 AM, Ismail SEZEN wrote:
>
> So, it’s more reasonable to identify the gender manually.
>
Both Paul ("Crocodile Dundee") Hogan and Donald Trump agree on that.
Jim
__
R-help@r-project.org mailing list --
Hi lily,
If you want to use aggregate, supply the name of the function:
aggregate(flow~year, data=df, "sum")
You can also use "by" like this
by(df$flow,df$year,FUN=sum)
I assume that you don't have to worry about missing months in a year.
Jim
:
On Thu, Dec 1, 2016 at 3:06 PM, lily li
Hi Erin,
I would look at:
par("usr")
to see what the range of the abscissa might be.
Jim
On Fri, Nov 25, 2016 at 2:03 PM, Erin Hodgess wrote:
> Hello! Happy Thanksgiving to those who are celebrating.
>
> I have a zoo series that I am plotting, and I would like to
`Hi Stuti,
Your problem is that if you want to have more than one command on a
single line, you must separate them with a semicolon.
j <- function() {
if(!exists ("a")){
a <- 1
} else{
a <- a+1
}; print(a)}
The above will work, but is usually considered bad form. What follows
is usually
Hi Olu,
If you always have only one non-NA value in the first three columns:
veg_df<-data.frame(col1=c(NA,"cassava","yam",NA,NA,NA,"maize"),
col2=c("pumpkin",NA,NA,"cherry",NA,NA,NA),
col3=c(NA,NA,NA,NA,"pepper","mango",NA))
veg_df$col4<-apply(as.matrix(veg_df),1,function(x) x[!is.na(x)])
Jim
Hi Ramnik,
Bert's answer is correct, and an easy way to see why is to look at:
c(1,F,"b")
[1] "1" "FALSE" "b"
The reason that "F" is translated to "FALSE" is that is its default
value when R is started. If you change that value:
F<-"foo"
c(1,F,"b")
[1] "1" "foo" "b"
as.logical(c(1,F,"b"))
Hi Farnoosh,
Try this:
for(id in unique(df$Subject)) {
whichsub<-df$Subject==id
if(exists("newdf"))
newdf<-rbind(newdf,df[whichsub,][which(!duplicated(df$dates[whichsub])),])
else newdf<-df[whichsub,][which(!duplicated(df$dates[whichsub])),]
}
Jim
On Tue, Nov 15, 2016 at 9:38 AM, Farnoosh
Hi Venky,
Unfortunately the MindReader package produces the following:
1. I want ice cream Desire
2. I like banana very much Pleasure
3. Tomorrow i will eat chicken Expectation
4. Yesterday i went to
Hi mokuram,
As others have noted, you will profit from a bit more knowledge about
"extraction":
sum(mtcars)
[1] 13942.2
This works because you have "extracted" the first column of the
"mtcars" data frame _as a data frame_
mtcars[1]
mpg
Mazda RX4 21.0
Mazda RX4 Wag
Hi Bernardo,
I don't think that your function is doing anything like you expect it to do:
test <- data.frame(var1=c("a","b","c"),var2=c("d","e","f"))
test
var1 var2
1ad
2be
3cf
You have a data frame with two columns, the first thing you do is
extract the first value in
0.847(0.291) = 0.43758
> Then divide by the sum of the weights:
> 0.43758 / 1.697 = 0.257855 = "animal size"
>
> This value can then be used to rank the animal according to its size for
> further analysis...
>
> Does this sound like a reasonable applic
Hi Salvatore,
If by "size" you mean volume, why not directly measure the volume of
your animals? They appear to be fairly small. Sometimes working out
what the critical value actually means can inform the way to measure
it.
Jim
On Sun, Nov 13, 2016 at 4:46 PM, Sidoti, Salvatore A.
Hi john,
I don't know whether this breaks any rules, but:
target_pair<-c(3,4)
pair_list<-list(c(1,2),c(3,4),c(5,6))
sapply(pair_list,identical,target_pair)
[1] FALSE TRUE FALSE
Jim
On Sun, Nov 13, 2016 at 1:32 PM, Jeff Newmiller
wrote:
> Sorry, that was a fail.
Hi Miluj,
Perhaps you didn't get my previous email. Let your data frame be named "msdf":
block_col_summ<-function(x,step,block_size,FUN="mean") {
dimx<-dim(x)
return_value<-NA
start<-1
end<-start+block_size-1
block_count<-1
while(end <= dimx[2]) {
return_value[block_count]<-
Thanks - it made me realize that I had reversed the column and row selection
rowMeans(x[seq(1:dim(x)[1],by=4),-1])
Jim
On Thu, Nov 10, 2016 at 8:30 AM, Uwe Ligges
<lig...@statistik.tu-dortmund.de> wrote:
>
>
> On 09.11.2016 22:06, Jim Lemon wrote:
>>
>> Hi Milu
Hi Milu,
Perhaps this will help:
apply(as.matrix(x[-1,seq(1:dim(x)[1],by=4)]),1,mean)
Jim
On Thu, Nov 10, 2016 at 4:00 AM, Miluji Sb wrote:
> Thanks a lot for your quick reply. I made a mistake in the question, I
> meant to ask every 4 (or 12) rows not columns. Apologies.
Geez, I must be too excited. I meant:
stringsAsFactors=FALSE
Jim
On Wed, Nov 9, 2016 at 7:44 PM, Jim Lemon <drjimle...@gmail.com> wrote:
> Hi Henry,
> You are certainly starting from the beginning. first, when you import
> the data from a CSV file, remember to ad
Hi Henry,
You are certainly starting from the beginning. first, when you import
the data from a CSV file, remember to add:
read.csv(...,stringsAsFactors=TRUE)
There will doubtless be other problems, but you have to start somewhere.
Jim
__
Hi lily,
My first guess is that the errors are due to trying to open a file like:
"fold1/file1.txt"
as:
"file1.txt"
That is, your code will generate filenames in the directories
fold1,..., without prepending the folder names. Maybe:
result_list<-list()
read_dirs<-paste("fold",1:3,sep="")
Hi Joshua,
Use Notepad++. It will also convert the linefeed EOLs to CR/LF.
Jim
On Mon, Nov 7, 2016 at 4:25 AM, Joshua Banta wrote:
> Dear everyone,
>
> Please consider the following code, which I am using to make a custom text
> file. (I need to build the text file
hi James,
I think you have to have a starting date ("origin") for as.Date to
convert numbers to dates.
Jim
On Sun, Nov 6, 2016 at 12:10 PM, James Hirschorn
wrote:
> This seemed odd so I wanted to check:
>
> > x <- foreach(i=1:10100, .combine='c') %do% {
Hi Lucas,
This is a rough outline of something I programmed years ago for data
cleaning (that was programmed in C). The basic idea is to read the
file line by line and check for a problem (in the initial application
this was a discrepancy between two lines that were supposed to be
identical).
Hi Elham,
As you have asked this question a large number of times in quite a few
places, and have received reasonable answers, I assume that you
already know that the gene names and associated values are in another
format. What you probably want to do is to convert the first column of
the data
Hi Alily,
Your image file didn't get through to the list. Try sending a PDF
image or perhaps providing a URL for an image stored on the internet.
Jim
On Wed, Oct 26, 2016 at 8:46 PM, Indhira, Anusha
wrote:
> Hi,
>
> I am trying to understand graph generated by
Hi Julia,
The error you got is usually due to data that should be numeric (1, 2,
3, ...) actually being a factor data type. This often happens when R
reads in a CSV file with the default option of converting character
variables (A, B, C,...) to factors. So your first column after input
may be a
Hi Andrea,
Assuming that your model is something like:
lm(y~x,data=mydata)
See what:
cor(mydata$y,mydata$x)
returns. If it is very very close to 1 or -1, there lies your problem.
If one or more of your predictor variables is an almost perfect
predictor of the response, you don't have much room
Hi again,
Sorry, the text command should read:
text(x=dta$age[samp010],y=dta$fit5[samp010],labels=dta$exposure[samp010],
col=expcol[samp010])
Jim
On Fri, Oct 21, 2016 at 8:50 AM, Jim Lemon <drjimle...@gmail.com> wrote:
> Hi mviljama,
> Without knowing what "dta" contains
Hi mviljama,
Without knowing what "dta" contains, it's a bit difficult. Here is an example:
set.seed(2345)
dta<-data.frame(age=sample(20:80,50),skin=sample(0:1,50,TRUE),
gender=sample(0:1,50,TRUE),trt=sample(0:1,50,TRUE),
exposure=sample(1:21,50,TRUE),fit5=runif(50))
# define your subset here
Hi Anze,
I'm not sure that this will work on Windows, but you can create a
function named ".First" (note the leading period) with something like
this:
.First<-function() setwd("C:/Users/anze")
To do this, start a session, enter the above line and then quit the
session, saving the current
Hi T,
Have you tried converting "clearntest" or "data" into a time series?
Jim
On Sat, Oct 15, 2016 at 4:47 AM, T.Riedle wrote:
> Dear all,
>
> I am trying to clean return data using the Return.clean() function in the
> PerformanceAnalytics package. Hence, my code looks as
Hi Andreas,
Try this:
fruit_2sds<-by(data2$molecule,data2$fruit,sd)*2
data2$newcol<-ifelse(data2$molecule>fruit_2sds[data2$fruit],1,0)
or even just:
data$newcol<-as.numeric(data2$molecule>fruit_2sds[data2$fruit])
Jim
On Fri, Oct 14, 2016 at 5:17 PM, Andreas Nord
Hi Hugo,
If you look at the help page for "distributions", you will see that it
describes a number of functions that return density functions, etc.
for specific distributions. If you are looking for something that
informs you which distribution might approximate an existing set of
values, try the
The crucial thing is probably:
"... they are translated to UTF-8 before comparison."
Although the first 127 characters seem to be identical to ASCII, in
which punctuation marks sorted before digits or letters, the encoding
to UTF-8 may make that impractical.
Jim
On Thu, Oct 13, 2016 at 8:55
Hi Adrian,
Perhaps what you want is this:
ajdat<-structure(c(112L, 0L, 579L, 1L, 131L, 1L, 2234L, 2L, 2892L, 1L,
528L, 0L, 582L, 2L), .Dim = c(2L, 7L), .Dimnames = list(c("GN",
"CN"), c("DC5", "DC8", "DC14", "DC18", "DC19", "DC20", "DC23"
)))
library(plotrix)
Hi Marna,
Isn't the conventional way to visualize depth as shades of blue?
library(plotrix)
depth.col<-color.scale(dat1$depth,extremes=c("lightblue",blue"))
Then color the lon/lat rectangles with depth.col
Jim
On Wed, Oct 12, 2016 at 7:49 PM, Marna Wagley wrote:
> Hi
Hi Margaret,
This may be a misunderstanding of your request, but what about:
mydata<-data.frame(oldvar=paste("topic",sample(1:9,20,TRUE),sep=""))
mydata$newvar<-sapply(mydata$oldvar,gsub,"topic.","parenttopic")
Jim
On Tue, Oct 11, 2016 at 1:56 AM, MACDOUGALL Margaret
Hi Heather,
I think the problem may be that you are trying to compare a date field
and a character string. R helpfully tries to wrangle the two into
comparable data types. While I don't know exactly what you have done,
as R for:
as.numeric(alldata$new.date.local)
and look at the value you get.
No, I'm quite certain that the answer is:
7*6 = 3*2^4 - 36/6
but I don't know the question
Jim
On Fri, Oct 7, 2016 at 9:48 AM, Dalthorp, Daniel <ddalth...@usgs.gov> wrote:
> Question and answer:
>
> 6*9 = (4)*13^1 + (2)*13^0
>
> On Thu, Oct 6, 2016 at 3:26 PM, Jim Lemon
It certainly does. As we are often confronted with requests for
solutions of problems so minimally defined as to challenge the most
eminent mindreader, this excels. We have a meta-problem as the
supplicant him- (or her-, I cannot even ascertain this) does not
appear to know what it is. Thus me are
Hi Syela,
Are the values in ASFR monotonically increasing with year?
Jim
On Tue, Oct 4, 2016 at 4:23 AM, Syela Mohd Noor wrote:
> Hi all, I had a problem with the parameter estimation of the Brass Gompertz
> model for my dissertation. I run the code for several times
Hi Maryam,
Your labels have been "greeked" as the font is too small to be
displayed properly. If you must use PNG format, specify your image
file at least twice as high.
png("pheatmap.png",width=1254,height=5000)
PDF would be a better choice as you can just zoom in and scroll down.
Jim
On
Hi Rolf,
I would try using dnf (or whatever the Ubuntu equivalent is) to
install the X11 fonts. You may have a GUI method for this in Ubuntu.
Jim
On Mon, Oct 3, 2016 at 7:55 AM, Rolf Turner wrote:
>
> Dunno exactly whom I should ask about this problem, but I thought
Hi Elysa,
This is pretty much a guess. If you understand the first error, i.e.
that there are nine rows in your input data frame (?) that contain NA,
NaN, or Inf values, have you tried manually removing those rows and
feeding the remainder to your code?
Jim
On Sun, Oct 2, 2016 at 7:19 PM, Elysa
Hi Kristi,
I assume that B, C and D are not empty, otherwise the answer is trivial.
create a directory under B named D
move the contents of the old D to the new D
delete the directory E beneath the new D
create a new directory C under the new D
move the contents of the old C to the new C
Hi Val,
Perhaps like this?
valdat<-read.table(text="obs, Year, bb, kk, y
1, 2001, 25 ,100, 12.6
2, 2001, 15 ,111, 24.7
3, 2001, 53, 110, 13.8
4, 2001, 50, 75, 9.6
5, 2001, 125, 101, 31.5
6, 2001, 205, 407, 65.7
7, 2001, 250, 75, 69.1",sep=",",header=TRUE)
selectval<-valdat$bb > 75
Hi John,
I know this is kind of dumb, but:
plot(0,xlim=range(xx$Nit,na.rm=TRUE),
ylim=range(xx$CT,na.rm=TRUE),type="n",
xlab="Nit",ylab="CT")
for(i in unique(xx$PID))
points(xx$Nit[xx$PID==i],xx$CT[xx$PID==i],
pch=i,col=i,type="b")
Jim
On Mon, Sep 26, 2016 at 11:43 AM, John Sorkin
Hi Saba,
Try this:
df<-matrix(c(0,NA,0,0,0,1,1,1,0,0,1,0,0,0,NA),nrow=3)
dimdf<-dim(df)
df1<-df==1
df[cbind(rep(FALSE,dimdf[1]),df1[,-dimdf[2]])]<-1
Jim
On Fri, Sep 23, 2016 at 12:27 PM, Saba Sehrish via R-help
wrote:
> Hi
>
> I have a matrix that contains 1565 rows and
Hi Mike,
Depending upon the flavor of Linux (looks like it's in the RedHat
family) it will usually start by running the command "R" in a
terminal. What does:
which R
say? Then look in the startup file (often in /usr/local/bin) for the
R_HOME directory.
Jim
On Tue, Sep 20, 2016 at 9:38 AM,
Hi mviljamaa,
Have a look a the twoord.plot function in the plotrix package.
Jim
On Tue, Sep 20, 2016 at 1:50 AM, mviljamaa wrote:
> I'm trying to plot two data sets on the same plot by using par(new=TRUE).
>
> However this results in the axis numbering and labels being
Hi Michael,
Maybe color2D.matplot (plotrix). Have a look at the examples.
Jim
On Sat, Sep 17, 2016 at 4:10 AM, Michael Young wrote:
> I am currently using "aheatmap" which is generating heatmaps based on
> Pearson correlation. My data consists of RPKM values for genes
Hi Carl,
order vs sort
The order function just returns the indices necessary to put the
object into the sorted order, while the sort function returns the
sorted object. If you want to use the order function:
newdf2<-df2[(order(df2[,1]),]
Yes, "with" can be a bit challenging. Think of it as:
Hi Darth,
Have a look at the tuneR package.
Jim
On Thu, Sep 8, 2016 at 3:57 PM, darth brando wrote:
> Apologies for the long title but it is semi specific a topic and yes I am a
> noobs user to the system. I have read the guide and will attempt to adhere to
> the
Hi Nick,
This is pretty rough, but it may help:
pdf("rd.pdf")
raredata<-rarecurve(cbind(netdata,netdata,netdata),label=FALSE,
col=rgb(0,0,1,0.1),xlim=c(0,100),ylim=c(0,80))
rect(100,0,104,80,col="white",border=NA)
dev.off()
Jim
On Wed, Sep 7, 2016 at 8:05 AM, Nick Pardikes
Hi Rosa,
Your data never seem to get through. Nevertheless, here is a suggestion:
rodat<-data.frame(id=1:20,age=sample(c("10-20","21-30","31-40"),20,TRUE),
weight=c(sample(40:70,18),110,120))
robp<-boxplot(weight~age,rodat)
rodat$id[which(rodat$weight %in% robp$out)]
Jim
On Mon, Sep 5, 2016
Hi Ryan,
How about:
names(merged.parameters)<-merging
Jim
On Mon, Sep 5, 2016 at 7:57 AM, Ryan Utz wrote:
> Hello,
>
> I have a vector of characters that I know will be object names and I'd like
> to treat this vector as a series of names to create a list. But, for the
>
Shouldn't get that with write.csv.
Jim
On Sun, Sep 4, 2016 at 9:29 PM, Christofer Bogaso
<bogaso.christo...@gmail.com> wrote:
> Didnt work getting unused argument error.
>
> On Sun, Sep 4, 2016 at 4:47 PM, Jim Lemon <drjimle...@gmail.com> wrote:
>> I suppo
I suppose you could try quote=TRUE
Jim
On Sun, Sep 4, 2016 at 8:13 PM, Christofer Bogaso
<bogaso.christo...@gmail.com> wrote:
> Thanks Jim. But my data is like that and I have to live with that. Any
> idea on workaround. Thanks,
>
> On Sun, Sep 4, 2016 at 3:40 PM,
Hi Christofer,
You have embedded commas in your data structure. This is guaranteed to
mess up a CSV read.
Jim
On Sun, Sep 4, 2016 at 5:54 PM, Christofer Bogaso
wrote:
> Hi again,
>
> I was trying to read a subset of Data from a CSV file using below code
> as
Hi Bailey,
Treat it as a guess, but try this:
for (i in c(1:3)){
y<-mydata[,i]
x <- mblm(y ~ Year, mydata, repeated = FALSE)
print(x)
}
I'm not sure that you can mix indexed columns with column names. Also,
Year is column 4, no?
Jim
On Sun, Sep 4, 2016 at 11:43 AM, Bailey Hewitt
Hi Yucheng,
Have a look at "An Introduction to R" (get there with "help.start()"), section :
3.1 Intrinsic attributes: mode and length
The distinction between numeric and integer modes in R may not be
obvious, but it is important at times.
Jim
On Fri, Sep 2, 2016 at 5:47 AM, Yucheng Song via
Sometimes the problem stems from chronic exposure to user interfaces.
Yesterday I prepared some material for a Mac user's presentation and
said,
"This text file tells you the names of the files you need for the presentation"
the response was,
"Can I click on it?"
I deleted all the files in the
Hi Kai,
Perhaps something like this:
kmdf<-data.frame(group=rep(c("exp","cont"),each=50),
time=factor(rep(1:5,20)),
condition=rep(rep(c("hot","cold"),each=25),2),
value=sample(100:200,100))
for(timeindx in levels(kmdf$time)) {
for(condindx in levels(kmdf$condition)) {
Hi Josephine,
Given the parameters you describe, you will probably have to write a
function to update the database of animals at regular intervals. You
can then run a number of repeats to get a better estimate of the final
populations. I tried this and it appears to work. I don't know of any
Hi Alexander,
A time series comes to mind, but perhaps all you need is a matrix with
0s for closed and 1s for open. Each row is a shop. Column names as the
times and the resolution is up to you. I think colSums will produce
what you want.
Jim
On Fri, Aug 26, 2016 at 1:10 AM,
Hi John,
I think it is "dput".
Jim
On Thu, Aug 25, 2016 at 8:00 AM, John Sorkin
wrote:
>
> There is a function that can be used to convert data structures such as a
> data frame into a different format that allows the data to be sent to the
> mailing list. The
Hi Gang Chen,
If I have the right idea:
for(zval in levels(myData$Z))
crossprod(as.matrix(myData[myData$Z==zval,c("X","Y")]))
Jim
On Wed, Aug 24, 2016 at 8:03 AM, Gang Chen wrote:
> This is a simple question: With a dataframe like the following
>
> myData <-
Hi SuBin,
This seems to work:
emp<-read.table(text="empno,ename,job,mgr,hiredate,sal,comm,deptno
7369,SMITH,CLERK,7902,1980-12-17,800,,20
7499,ALLEN,SALESMAN,7698,1981-02-20,1600,300,30
7521,WARD,SALESMAN,7698,1981-02-03,1250,500,30
7566,JONES,MANAGER,7839,1981-03-02,2975,,20
Hi Adrian,
I had to add an extra color, but this might do what you want:
chxx<-matrix(runif(100,-3.32,4.422),nrow=10)
chxx.cut<-as.numeric(cut(chxx,breaks=c(-3.5,-1.96,-1,0,1,1.96,5)))
chxx.col<-c("#FF","#FF","#FF","#FF","#FF",NA)[chxx.cut]
library(plotrix)
Hi Adrian,
Try this:
sm$rowmeans<-rowMeans(sm[,2:length(sm)])
sm<-sm[order(sm$Gene,sm$rowmeans,decreasing=TRUE),]
sm[-which(duplicated(sm$Gene)),]
Jim
On Fri, Aug 19, 2016 at 7:33 AM, Adrian Johnson
wrote:
> Hi Group,
> I have a data matrix sm (dput code given
Hi Lauren,
As Sarah noted, if your blank responses are coming as NAs, it may be
best to leave them alone until you have done the calculations:
survey$responses<-!is.na(survey[,c("q1","q2","q3")])
survey$sum_survey<-rowSums(survey[,c("q1","q2","q3")],na.rm=TRUE)
# the next line returns a logical
;-paste(x,collapse="/")
return(xdate)
}
newx<-as.Date(sapply(xbits,long_year,new_century),"%m/%d/%Y")
return(newx)
}
Jim
On Mon, Aug 15, 2016 at 10:47 AM, Jim Lemon <drjimle...@gmail.com> wrote:
> Hi Glenn,
> Perhaps this will help:
>
> dateCentury<
Hi Sri Ram,
Do you mean that you want to produce a Gantt chart? Have a look at the
example for gantt.chart in the plotrix package.
Jim
On Wed, Aug 10, 2016 at 2:58 PM, Sriram Kumar wrote:
> Dear all,
>
> i am presently doing the r codes for developing the shiny app fro
as time evolves. That approach would not allow rectangles to
expand over time, but that could be accommodated. It's more
complicated than either of the two, but I think it can be done.
Jim
On Tue, Aug 9, 2016 at 8:19 AM, Jim Lemon <drjimle...@gmail.com> wrote:
> Hi Loris,
> This look
Hi Loris,
This looks a lot like a Gantt chart with variable bar widths. I'll
check it when I have a bit of time and repost.
JIm
On Mon, Aug 8, 2016 at 6:12 PM, Loris Bennett
wrote:
> Hi,
>
> I want to visualise temporal events as rectangles, one side of the
>
Hi Jennifer,
A very pedestrian method, but I think it does what you want.
remove_rows_after_1<-function(x) {
nrows<-dim(x)[1]
rtr<-NA
rtrcount<-1
got1<-FALSE
thisID<-x$ID[1]
for(i in 1:nrows) {
if(x$ID[i] == thisID && got1) {
rtr[rtrcount]<-i
rtrcount<-rtrcount+1
}
if(x$ID[i] !=
d|word
> and when I try to
> names(unlist(sapply(vdat$tweet,grep,pattern=badwords))) there is a mistake.
> I had this question before but do you know by any chance how to separate
> just those words in a column badwords and not include NA's or blanks.
>
> Thank you,
&g
Hi Vladimir,
Do you want something like this?
vdat<-read.table(text="numberoftweet,tweet,locations,badwords
1,My cat is asleep,London,glum
2,My cat is flying,Paris,dashed
3,My cat is dancing,Berlin,mopey
4,My cat is singing,Rome,ill
5,My cat is reading,Budapest,sad
6,My cat is
Hi Yuan,
Your file didn't make it. The error message you got is generally due
to a misspelt filename or to the file not being where you think it is.
Jim
On Fri, Aug 5, 2016 at 8:10 PM, Yuan Jian via R-help
wrote:
> Hello,I have a SAS formatted file as attached, when I use
[i+1])
newy<-c(newy,y[i+1])
}
lastdx<-dx
lastdy<-dy
}
return(list(x=newx,y=newy))
}
x<-c(5,4,4,3,2,2,1,1,2,2,3,4,5,5,6,6,7,8,8,9,8,7,7,6,6,5,5)
y<-c(1,2,2,3,4,4,5,6,6,7,8,8,9,8,8,7,7,6,6,5,5,4,3,3,2,2,1)
plot(1:9,type="n")
lines(x,y)
newxy<-pixel8(x,y)
lin
Hi Zun Yin,
The first problem requires something like this:
pixel8<-function(x,y,pixsize=1) {
nsteps<-length(x)-1
newx<-x[1]
newy<-y[1]
for(i in 1:nsteps) {
dx<-diff(x[i:(i+1)])
dy<-diff(y[i:(i+1)])
if(dx && dy) {
newx<-c(newx,x[i]+dx,x[i]+dx)
newy<-c(newy,y[i],y[i]+dy)
}
else
Hi Thomas,
Be aware that if you are attempting to calculate "birthday age", it is
probably better to do it like this:
bdage<-function(dob,now) {
dobbits<-as.numeric(unlist(strsplit(dob,"/")))
nowbits<-as.numeric(unlist(strsplit(now,"/")))
return(nowbits[3]-dobbits[3]-
(nowbits[2]
Hi Nelly,
The message David suggested was about scaling the values, not
adjusting the parameters. It is quite possible that the empirical
distribution is nothing like beta or Weibull. Have you tried plotting
the values with "density"?
Jim
On Fri, Aug 5, 2016 at 6:56 AM, Nelly Reduan
Hi Roslina,
You only specify space for two plots in:
par(mfrow=c(1,2))
However, you only try to plot two plots, so I will assume that you
only want two. You haven't defined "x" in the above code, which will
cause an error. The code below gives me two plots as I would expect (I
made up the data
Hi Roslina,
As we do not know whether the file actually exists, all I can do is to
suggest that you look in your file manager (Windows Explorer,
probably) and see if the file is where you think it is. The problem is
most likely a spelling error somewhere in the path or filename.
Jim
On Tue, Aug
Hi Courtney,
I haven't seen any answers to your question, and perhaps it is because
others, like I, were unable to open the file you attached. The
uninformative labels you are getting may be the names of values or the
character value of factors. Is there a sample data set from the
original file
Hi Alain,
You are probably storing the result, replicated five times, in df$VAR.
Each cycle of the loop replaces the last value with the current value.
If you really want the entire output of binom.test in the last column:
multi.binom.test<-function(xs,ns) {
reslist<-list()
for(i in
;), row.names = c(NA,
> -6L), class = "data.frame")
>
> Thank you.
>
> On Fri, Jul 29, 2016 at 2:30 PM, roslinazairimah zakaria
> <roslina...@gmail.com> wrote:
>>
>> I have one more question, how do I get the sum for the years. Thank you.
>>
>
Hi Roslina,
Try this:
aggbalok_mth[aggbalok_mth$year %in% 2009:2014,]
Jim
On Fri, Jul 29, 2016 at 1:12 PM, roslinazairimah zakaria
wrote:
> Dear r-users,
>
> I would like to extract year from 2009 to 2014 with the corresponding month
> and rain amount.
>
> I tried this:
Hi Gang,
This is one way:
gangdat<-read.table(text="subject QMemotion yi
s1 75.1017 neutral -75.928276
s2 -47.3512 neutral -178.295990
s3 -68.9016 neutral -134.753906
s1 17.2099 negative -104.168312
s2 -53.1114 negative -182.373474
s3 -33.0322 negative
Hi Maria,
The "plot.gam" function doesn't use the "col" argument for lines, but
does change the color of points in the second example on the help
page. There doesn't seem to be an easy way to change the function to
get what you want.
Jim
On Tue, Jul 26, 2016 at 11:47 PM, Maria Lathouri via
e to be able to write my own script for this as I have many
> images/ pdf's in a folder and would like to batch process them using an R
> script!!
> Thanks
>
>
> On Tuesday, July 26, 2016, Jim Lemon <drjimle...@gmail.com> wrote:
>>
>> Hi Shane,
>&g
Hi Shane,
FreeOCR is a really good place to start.
http://www.paperfile.net/
Jim
On Wed, Jul 27, 2016 at 6:11 AM, Shane Carey wrote:
> Hi,
>
> Has anyone ever done any ocr in R?? I have some scanned images that I would
> like to convert to text!!
> Thanks
>
>
> --
> Le
901 - 1000 of 3379 matches
Mail list logo