I guessed it too, but my command
as.Date(Sys.time(),tz="EDT")
[1] "2014-06-20"
doesn't give warning message you got for PDT . I thought EDT was a valid TZ !
Now I changed it to :
> as.Date(Sys.time(),tz="America/New_York")
[1] "2014-06-19"
Thanks.
-Original Message-
From: "William Du
Is it a time zone issue? I get:
R> Sys.time()
[1] "2014-06-19 20:09:25 PDT"
R> as.Date(Sys.time())
[1] "2014-06-20"
R> as.Date(Sys.time(),tz="US/Pacific")
[1] "2014-06-19"
R> as.Date(Sys.time(),tz="PDT")
[1] "2014-06-20"
Warning message:
In as.POSIXlt.POSIXct(x, tz = tz) : unknown timezone 'PDT'
1. This is a question about statistical methodology, not R. Hence
inappropriate here.
2. Replies should therefore be private.
3. Consult the literature.
Cheers,
Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowl
On Jun 19, 2014, at 12:08 PM, efridge wrote:
> Hello,
>
> Firstly, real new to R here.
>
> I have a function intended to evaluate the values in columns spread over
> many tables. I have an argument in the function that allows the user to
> input what sequence of tables they want to draw data fr
Dear all,
> Sys.time()
[1] "2014-06-19 22:19:17.976818 EDT"
> as.Date(Sys.time())
[1] "2014-06-20"
>
why this happens ?
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-p
Hello,
Firstly, real new to R here.
I have a function intended to evaluate the values in columns spread over
many tables. I have an argument in the function that allows the user to
input what sequence of tables they want to draw data from. The function
seems to work fine, but when the user inputs
Dear Pablo,
> Yes, effectively utilizando useRaster = FALSE, the plot is printed.
Muy bien!
> Only the ribbon appears without color.
Try setting ribargs=list(useRaster=TRUE).
> I'm using R version 3.0.2, Windows 7 system, and spatstat 1.33-0 package
> version.
Things may improve if you upg
I have several small biological count-based data sets with one or more
rows having zero proportion. The other proportions in the row sum to 1.000
(or 0. in the sixth data row below because of rounding errors in the
computer). An example is:
sampdate filter gather graze predate shred
2
On Thu, 19 Jun 2014, Adams, Jean wrote:
If your data frame is called df, try
row.names(df) <- df$sampdate
Jean,
Yep. That looks familiar.
Many thanks,
Rich
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
Rich,
If your data frame is called df, try
row.names(df) <- df$sampdate
Jean
On Thu, Jun 19, 2014 at 5:07 PM, Rich Shepard
wrote:
> I recall reading how to do this somewhere, but I cannot find just where I
> read it. I have compositional data frames of this format:
>
> sampdate filter
Thank you. That worked.
On 19-Jun-2014 3:24 PM, Uwe Ligges wrote:
On 19.06.2014 23:50, Chris Dolanc wrote:
Hello,
I have a data frame with > 5000 columns and I'd like to be able to make
subsets of that data frame made up of certain columns by using part of
the column names. I've had a surpri
On Thu, 19 Jun 2014 02:50:20 PM Chris Dolanc wrote:
> Hello,
>
> I have a data frame with > 5000 columns and I'd like to be able to
make
> subsets of that data frame made up of certain columns by using
part of
> the column names. I've had a surprisingly hard time finding
something
> that works
On Thu, 19 Jun 2014 01:42:30 PM message wrote:
> Readers,
>
> For data set:
>
> a, 90, 10
> b, 60, 40
> c, ,
> d, , 50
>
> A plot was attempted:
>
> dataset<-as.matrix(read.csv("datafile.csv",header=FALSE))
> barplot<-(dataset,horiz=TRUE)
>
> A warning message is returned, about NAs introduced
On 19.06.2014 23:50, Chris Dolanc wrote:
Hello,
I have a data frame with > 5000 columns and I'd like to be able to make
subsets of that data frame made up of certain columns by using part of
the column names. I've had a surprisingly hard time finding something
that works by searching online.
I recall reading how to do this somewhere, but I cannot find just where I
read it. I have compositional data frames of this format:
sampdate filter gather graze predate shred
1 2000-07-18 0.0550 0.5596 0.0734 0.2294 0.0826
2 2003-07-08 0.0734 0.6147 0.0183 0.2294 0.0642
3 2005-07-13 0.1
Hello,
I have a data frame with > 5000 columns and I'd like to be able to make
subsets of that data frame made up of certain columns by using part of
the column names. I've had a surprisingly hard time finding something
that works by searching online.
For example, lets say I have a data fram
On Wed, Jun 18, 2014 at 2:26 PM, Judson wrote:
> Dear Dr. Bates,
> I'm just learning R and I want to use it for
> statistical problems and also some problems
> that are just mathematical. Apparently I'm
> not using the packages right and none of the
> books I've found cover what should be
Hello folks!
I'm using R-Package {vars} and I'm trying to estimate an A-Model.
I have serious problems regarding the restrictions.
1) My A-Matrix needs (!) to have the following form:
# 1 NA NA NA
# 0 1 NA NA
# 0 0 1 NA
# 0 0 0 1
That is done in R by:
A_Matrix <- diag(4) # m
Hi,
I was wondering if anybody could share their experience with interfacing
R with Oracle databases for extraction of large objects. I would be more
specifically interested in how to extract large objects storing big text
files.
Thank you
Sebastien
On 19/06/2014 07:00, Adrian Baddeley wrote:
I think I have the solution to the problem
experienced by users of 'spatstat' on Windows machines,
who are finding that plot.im() gives empty colour images.
Short answer: set useRaster=FALSE in the call to plot.im.
Long answer:
spatstat::plot.im calls
On Jun 18, 2014, at 11:31 PM, Daniel Schwartz wrote:
> I have coded qualitative data with many (20+) different codes from a survey
> in an excel file. I am using the with() function to output the codes so we
> know what's there. Is it possible to direct the output from with() to an
> excel file?
To get the maximum:
lapply(split(df, df$Year), function(x) max(sapply(1:(nrow(x)-2), function(i)
with(x, mean(Amount[i:(i+2)],na.rm=TRUE)
#$`1985`
#[1] 4.17
A.K.
On , arun wrote:
Hi,
You may try:
df <- structure(list()
lapply(split(df, df$Year), function(x) sapply(1:(nrow(x)-
Hi,
You may try:
df <- structure(list()
lapply(split(df, df$Year), function(x) sapply(1:(nrow(x)-2), function(i)
with(x, mean(Amount[i:(i+2)],na.rm=TRUE
#$`1985`
# [1] 4.167 3.833 0.833 0.333 0.333 0.000 0.000
# [8] 0.000 0.000 0.000 0.000 0.0
Hey there,
I was wondering if anyone might happen to know of any books that cover this?
I've read and been working through 'introductory time series in R' by
Cowpertwait/ Metcalfe and chapter 12 is mostly devoted to the Bayesian approach
but the examples aren't really relevant to what I'm doin
On 19/06/2014, 3:10 PM, Christian Hoffmann wrote:
> Hi,
>
> I can successfully define in .R and in > R
>
> "%&%" <- function(a,b) { paste(a,b,sep="") }
>
> nd use in R >
>
> "a" %&% "b"
> [1] "ab"
>
> but in a package definition .Rd
>
> \name{pasteInfix}
> \alias{pasteInfix}
> \alias{
On 19/06/2014, 1:00 PM, Céline b wrote:
> Hello,
>
> I'm trying to add a colorbar to a 3d map using rgl.
> For this purpose, I draw the map in a similar way of persp3d example :
>
> lat <- matrix(seq(90,-90, len=50)*pi/180, 50, 50, byrow=TRUE)
> long <- matrix(seq(-180, 180, len=50)*pi/180, 50,
Now that it is simplified, we see that you are incrementing the size
of an array at each step. This is
a very inefficient practice in R. For comparison,
## what you are doing
system.time({
tmp <- NULL
for (i in 1:1) tmp <- rbind(tmp, 1:2)
})
## user system elapsed
## 0.622 0.297
Dear Adrian,
Yes, effectively utilizanddo useRaster = FALSE, the plot is printed. Only
the ribbon appears without color.
I'm using R version 3.0.2, Windows 7 system, and spatstat 1.33-0 package
version.
Best wishes
Pablo
2014-06-18 19:50 GMT-05:00 Adrian Baddeley :
> Dear Pablo
>
> Please prov
Hi,
I can successfully define in .R and in > R
"%&%" <- function(a,b) { paste(a,b,sep="") }
nd use in R >
"a" %&% "b"
[1] "ab"
but in a package definition .Rd
\name{pasteInfix}
\alias{pasteInfix}
\alias{\%&\%
}
\usage{ a \%&\% b
}
will fail in R CMD check --as-cran saying
"I am"
Hi Raghu,
Using the example you provided. If you want Q3 for year 2011 and 2013.
dat[grep("2011 Q3|2013 Q3", Qtr1),] #change accordingly
# ID Phase RESEARCH Area Date Result
#1 100 IV S_Care A&P 7/23/2013 Positive
#5 2005 IV Speci TH 8/4/2011
#6 2006 III Speci
Hello,
I'm trying to add a colorbar to a 3d map using rgl.
For this purpose, I draw the map in a similar way of persp3d example :
lat <- matrix(seq(90,-90, len=50)*pi/180, 50, 50, byrow=TRUE)
long <- matrix(seq(-180, 180, len=50)*pi/180, 50, 50)
r <- 6378.1 # radius of Earth in km
x <- r*cos(la
Hello,
I need to do a principal component analysis with EQUAMAX-rotation.
Unfortunately the function principal() I use normally for PCA does not offer
this rotation specification. I could find out that this might be possible
somehow with the package GPArotation but until now I could not figure out
I have coded qualitative data with many (20+) different codes from a survey
in an excel file. I am using the with() function to output the codes so we
know what's there. Is it possible to direct the output from with() to an
excel file? If not, what's another function that has the same, er,
function
Dear R users,
I have this kind of data set:
structure(list(Year = c(1985L, 1985L, 1985L, 1985L, 1985L, 1985L,
1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L, 1985L,
1985L, 1985L, 1985L, 1985L, 1985L), Day = 1:20, Month = c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
Tham,
What you have found is that the cats eyes of the error bars will throw an
error if there no variance for a cell (or, just one person in a cell). This I
will fix so that it complains but doesn’t quit.
The example you were running was filtering out the subjects less than 10 years
old and
R version 3.1.0 (2014-04-10) -- "Spring Dance. Platform:
x86_64-apple-darwin13.1.0 (64-bit).
I would like to convert the following function from nlme to nlmer. I am
finding it difficult to apply the documentation I can find on this procedure to
this problem. The function predicts earthquake
Dear Pablo
Please provide details of the system you are using (Windows - version? R
version? spatstat version?)
Also, when you issue the plot command, what graphics device are you using?
[To find out, type dev.cur() after performing the plot, and read the printout]
Try changing the colour map
I think I have the solution to the problem
experienced by users of 'spatstat' on Windows machines,
who are finding that plot.im() gives empty colour images.
Short answer: set useRaster=FALSE in the call to plot.im.
Long answer:
spatstat::plot.im calls graphics::image.default with the argument
An alternative would be to use the arrangeGrob function of the gridExtra
package to generate the final montage, and then use ggsave:
figure1<-arrangeGrob(plot1,plot2,ncol=2)
ggsave(...)
Best regards
Nelson
On Thu, Jun 19, 2014 at 8:45 AM, ONKELINX, Thierry wrote:
> Dear Adam,
>
> ggsave() w
Hi Martin,
Thanks for the useful comments. It has greatly improved the efficiency
of my functions. I am sorry that I forgot to paste the functions varG
and others which I have done here for reproducibility.
#
## a function to calculate h2
## (heritability)
###
> dataset<-as.matrix(read.csv("datafile.csv",header=FALSE))
You should always inspect the dataset immediately after reading it in, before
doing other manipulations on it. Converting data from one format to
another is always going to be error-prone. Plotting it, say with
pairs() or just plot(), i
> lmramba
> on Wed, 18 Jun 2014 20:00:15 + writes:
> Hi Jim. If I avoid the dataframe, how can use the function model.matrix()
to
> build the incident matrices X, And Z? I tried saving the design as matrix
> but ghen I got the wrong design matrix.
I think you are en
I'm not sure we have enough information, but given your matrix:
> mt <- matrix(c(1, 2, 3, 10, 15, 20, 20, 40, 80, 30, 60, 120), 3, 4)
> mt
[,1] [,2] [,3] [,4]
[1,]1 10 20 30
[2,]2 15 40 60
[3,]3 20 80 120
# Get differences between adjacent values in each column
>
On 19 Jun 2014, at 15:42, message wrote:
> Readers,
>
> For data set:
>
> a, 90, 10
> b, 60, 40
> c, ,
> d, , 50
>
> A plot was attempted:
Wonder who attempted this. :-)
>
> dataset<-as.matrix(read.csv("datafile.csv",header=FALSE))
Look at your dataset; I’d say it is clearly not what you w
You are really not helpful here. Are we talking the same scientific language?
Br. Frede
Sendt fra Samsung mobil
Oprindelig meddelelse
Fra: carol white
Dato:19/06/2014 15.46 (GMT+01:00)
Til: Frede Aakmann Tøgersen ,Bart Kastermans
Cc: r-help@r-project.org
Emne: Re: [R] extrac
Dear Tham,
The example you were running was filtering out the subjects less than 10 years
old and more than 80. Somehow you suppressed this filtering which lead to the
error message. The filtering was done to avoid the problem you detected.
I have fixed error.bars.by so that it now will just
I realize that that the problem arises if there is a different number of
negative numbers in the rows and columns of the original matrix. In this case,
the resulting matrix won't have the same number of rows for all columns. The
problem for ex doesn't arise for my example but for Bart's example
Readers,
For data set:
a, 90, 10
b, 60, 40
c, ,
d, , 50
A plot was attempted:
dataset<-as.matrix(read.csv("datafile.csv",header=FALSE))
barplot<-(dataset,horiz=TRUE)
A warning message is returned, about NAs introduced by coercion and an
undesirable graph. The desired output is something simi
Readers,
For a matrix:
1 10 20 30
2 15 40 60
3 20 80 120
Using a spreadsheet, a differential function can be applied to the data
as a formula:
|(10-15)/(1-2)| ... repeated for each pair of adjacent values
What is the corresponding function in R please?
Is it better to write a new function, or
As Peter and Bart I really have a problem understanding you.
Perhaps if you tell us what your desired result is going to used for we can be
more helpful. You can do that using your latest example.
In that example you want a matrix of sets of row and column indices. This will
probably have to be
This is a simple question but could not find any specific help information:
I have a DNAbin object created with read.dna() of ape and would like to
remove several sequences of "conflicting taxa". How can I do it using a
vector with the lables of the taxa to remove?
Thanks in advance
On 19 Jun 2014, at 15:16, carol white wrote:
> tm.1=rbind(c(1,-3,2,-4), c(1,-3,2,-4),c(1,-3,2,-4))
>
> > which(tm.1 > 0, arr.ind=TRUE)
> row col
> [1,] 1 1
> [2,] 2 1
> [3,] 3 1
> [4,] 1 3
> [5,] 2 3
> [6,] 3 3
>
> so the answer should have the elements of tm.1 wi
 tm.1=rbind(c(1,-3,2,-4), c(1,-3,2,-4),c(1,-3,2,-4))
> which(tm.1 > 0, arr.ind=TRUE)
    row col
[1,]Â Â 1Â Â 1
[2,]Â Â 2Â Â 1
[3,]Â Â 3Â Â 1
[4,]Â Â 1Â Â 3
[5,]Â Â 2Â Â 3
[6,]Â Â 3Â Â 3
so the answer should have the elements of tm.1 with the following indexes
1,1 1,3
2,1 2,3
3
If you give an example of input and desired output I can think about this. But
at this
point I do not understand what you want. In the example I gave the positive
elements do
not form a submatrix in any way I can think of.
On 19 Jun 2014, at 15:04, carol white wrote:
> well it gives a vector
This _was_ in the answer you got, but to clarify things, perhaps try this:
(M <- matrix(1:9,3,3))
(ix <- rbind(c(3,2),c(1,3)))
M[3,2]
M[1,3]
M[ix]
-pd
On 19 Jun 2014, at 14:12 , carol white wrote:
> The extracted values don't form a matrix and that's the question how to
> extract because whic
The extracted values don't form a matrix and that's the question how to extract
because which returns the indexes? that is, from
1,1
2,1
1,2
how to retrieve values?
Or if at the position 2,1, there is a negative value, how to retrieve
1,1
1,2
Carol
On Thursday, June 19, 2014 1:29 PM, Bart
On 19 Jun 2014, at 13:19, carol white wrote:
> Hi,
> Is there a way to extract a subset of non-contiguous elements of a matrix
> elegantly and with 1 or very few scripts?
>
> Suppose I have a matrix of positive and negative numbers (m) and I want to
> retrieve only the positive number. This I
Hi,
Is there a way to extract a subset of non-contiguous elements of a matrix
elegantly and with 1 or very few scripts?
Suppose I have a matrix of positive and negative numbers (m) and I want to
retrieve only the positive number. This I can do
which(m>0, arr.ind=T) which gives the indices of po
Dear Adam,
ggsave() works only with single ggplot object. You need the standard R way of
saving those plots.
1) open a suitable device
2) plot the figures
3) close the device
tiff(filename = "Figure 1.tiff", scale = 1, width = 10, height = 5, units =
"cm", dpi = 300)
grid.arrange(plot1, plot2,
59 matches
Mail list logo