I'm a beginner with R.
I have two vectors in character format. I tried to get the intersection of
these two vectors using intersect£¨£©. But there is no result. The process is
below:
> a<-c("CREB2¡± ,¡°ELK1¡± ,¡°ELK4¡± ,¡°MYC¡± ,¡°NR4A1¡± ,¡°FOS¡± ,¡°SRF¡±
> ,¡°TAU¡± ,¡°STMN1¡± ,¡°CPLA2")> a
Hi,
XLConnect can very well deal with missing values. By default, only
blank cells (cells not containing any values) will be treated as
missing values. Cells containing the text "NA" are not automatically
treated as missing values as "NA" is a valid non-missing text string.
If you want to treat th
Hello, everyone, I wish you would be kind enough to give me a hand.
I am trying to send a mail through R and have met some problems.
library(sendmailR)
from <- sprintf("", Sys.info()[4])
to <- ""
subject <- "Hello from R"
body <- list("It works!", mime_part(iris))
sendmail(from, to, subject, body
Hi,
Use ?paste()
dat1<- read.table(text="name value
central -10.91699497
western -10.16521404
upper -6.915860837
lower -6.546794281
southern -6.382722608",sep="",header=TRUE,stringsAsFactors=FALSE)
number1 <- c(1,3,2,4,5)
dat1[,1] <- paste0(number1,dat1[,1])
A.K.
On Tuesday,
Hi,
Try:
bp+theme(axis.text=element_text(size=14),axis.title=element_text(size=16,face="bold"))
A.K.
On Tuesday, December 3, 2013 9:41 PM, David Arnold
wrote:
All,
Say I do:
require(ggplot2)
names(PlantGrowth)
bp <- ggplot(PlantGrowth,aes(x=group,y=weight))+geom_boxplot()
But the default
On 2013年12月04日 08:21, David Winsemius wrote:
> library(car)
> # will also need rgl
> scatter3d(dat$X, dat$Y, dat$Value)
>
> library(akima)
> akima.li <- interp(dat$X, dat$Y, dat$Value,
>xo=seq(min(dat$X), max(dat$X), length = 100),
>yo=seq(min(dat$Y), max
Hi R user,
I have been struggling to add number in front of text. It mus t be easy. but I
could not figure it out.
example
I have this data:
name value
central -10.91699497
western -10.16521404
upper -6.915860837
lower -6.546794281
southern -6.382722608
I want to following.
SOLVED:
xs <- canonical(smell.rsm)$xs
> xs
x1x2x3
0.1219125 0.1995746 1.7705249
> persp(smell.rsm,~x1+x2,at=xs,contour=TRUE)
>
On Tue, Dec 3, 2013 at 9:33 PM, Erin Hodgess wrote:
> Dear R People:
>
> I am using Response Surface Models and and also using the "persp" fun
Dear R People:
I am using Response Surface Models and and also using the "persp" function
to plot them.
Today my particular model is y~ x1 + x2 + x3
I can fit my RSM easily. My question is: how do I use the persp such that
I can fix the x3 at a particular value, please?
> smell.code <- coded.
Dear all,
I am looking for a consultant who can help me to solve a mathematical/
statistical problem I have. The problem is more conceptual in nature (How
to solve a given problem analytically) than programming-related. Although I
also would need some programming support later, once the analytic s
All,
Say I do:
require(ggplot2)
names(PlantGrowth)
bp <- ggplot(PlantGrowth,aes(x=group,y=weight))+geom_boxplot()
But the default axis labels and tick labels are just too small for me to
read.
What is the easiest was to enlarge the font size of axis labels and tick
labels?
Thanks.
D.
--
Vi
On Dec 3, 2013, at 5:37 AM, Hadley Wickham wrote:
> A better solution to this problem is to use character indexing:
>
> x <- c("Tuesday", "Thursday", "Sunday")
> c(Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5,
> Saturday = 6, Sunday = 7)[x]
>
> http://adv-r.had.co.nz/Subsett
Well, thanks for sending me the files but I'm sorry to be rather
pessimistic as for now...
that's exactly what I was suspecting after a first look at the data
in your first email... The short answer is: an obsolete IPA
transcription system is used in the files so the student should rework
the data
On Dec 2, 2013, at 8:02 PM, Mercutio Florid wrote:
> I want to map out a mostly flat area of land, 300 meters on a side.
>
>
> I want to make (x,y,z) triples where x and y vary between -150 and 150 and
> there is just one z value.
>
>
> Eventually I will try to use graphics to actually dra
But I think Bill continues to confuse the sort order of factor levels
with the order of an ordered factor.
?ordered
## and some time with an R tutorial might help!
Note:
> f1 <- factor(1:5, lev = 5:1)
> f2 <- factor(1:5,lev=5:1,ordered=TRUE)
> identical(f1,f2)
[1] FALSE
> ## They are different c
On Dec 2, 2013, at 6:58 PM, Bill wrote:
> Duncan,
> Thanks. Why doesn't
> coloursf2 <- factor(1:8, levels = 8:1)
>
> give an ordering when you do str(coloursf2) like
> "8"<"7"<"6" ...
Because the default for 'ordered' in factor is FALSE:
> coloursf2 <- factor(1:8, levels = 8:1, ordered=TRUE)
Hi Jim,
I tried as you described but did not succeed.
Can I send you sample data?
Thanks,
Zilefac.
On Tuesday, December 3, 2013 4:19 PM, Jim Lemon wrote:
On 12/04/2013 08:59 AM, Jim Lemon wrote:
> On 12/04/2013 05:26 AM, Zilefac Elvis wrote:
>> Hi,
>> I have rainfall data from 100 locations,
Dear R-project
I could not validate one logistic model because when I used the function
lrm.fit of the package rms the program showed a error message. It said that
the variable Clam and offset must have same length.
ext <- lrm.fit( ,Clam, offset="X")
In this case, Clam is variable depend or vari
On Tuesday, December 3, 2013 2:31 PM, Luis Santomé Collazo
wrote:
Hi everyone,
HI,
##Creating a reproducible example
set.seed(45)
lst1 <- lapply(1:3,function(i)
data.frame(AAA=sample(c(NA,1:10),20,replace=TRUE),BBB=sample(40,20,replace=TRUE)))
lapply(seq_along(lst1),function(i)
write.tab
Hi,
Try:
comb[,as.numeric(temp[1])]
#[1] "V1" "V2"
comb[,as.numeric(temp[3])]
#[1] "V1" "V3"
A.K.
i have two data frame
>comb
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] "V1" "V1" "V1" "V1" "V1" "V1"
[2,] "V2" "V2" "V2" "V3" "V3" "V4"
>table
On 12/04/2013 08:59 AM, Jim Lemon wrote:
On 12/04/2013 05:26 AM, Zilefac Elvis wrote:
Hi,
I have rainfall data from 100 locations, with coordinates for each
location available.
Now, I have a correlation matrix showing the correlation between
rainfall at a single location against all other locati
I can't tell since you didn't post any code, so forgive me if you've
tried this. XLConnect has a colTypes parameter so you could try
specifying the relevant columns to be read in as character, set
forceConversion = TRUE, and then use as.numeric. Something like this:
as.numeric(sub(",", ".", I
On 12/04/2013 05:26 AM, Zilefac Elvis wrote:
Hi,
I have rainfall data from 100 locations, with coordinates for each location
available.
Now, I have a correlation matrix showing the correlation between rainfall at a
single location against all other locations and so on for the 100 locations.
Ho
Hi R user,
I am just wondering how I can add Standard error bar in the interaction plot. I
used the following code but I don't know how i can edit this to put a started
error's bar on the mean.
Would you give me some hints? or do other packages provide the information
about plotting the SE bar
Dear R-helpers,
I would like to test whether a random effect is significant when
implemented with bs="re" in mgcv gam. For example, if I run:
M3b <- gam(DVY ~ s(SessIDX, fTX, bs = "re") + factor(TX),
data = PCP,
family = quasipoisson(link="log"), method="REML")
summary(M
Hi,
I have rainfall data from 100 locations, with coordinates for each location
available.
Now, I have a correlation matrix showing the correlation between rainfall at a
single location against all other locations and so on for the 100 locations.
How can I visualize this correlation matrix using
> Pretty much nothing can convert arbitrary PDF files to unicode. It
> depends a
> lot on what is in the PDF to begin with -- properly encoded text or just
> bitmapped images, for example.
> I would recommend you search around to see whether there's a related
> archive in a different for
HI,
You could try:
mat1 <- matrix(0,8,8)
diag(mat1) <- 5
mat2 <- apply(mat1,2,rev)
diag(mat2) <- 5
indx<- which(mat2==5)
mat2[indx[indx%%8==1]+1] <-1
mat2[indx[indx%%8==0]-1] <-1
mat2[indx[!(indx%%8==0 | indx%%8==1)]-1][mat2[indx[!(indx%%8==0
|indx%%8==1)]-1]==0] <- 1
mat2[indx[!(indx%%8
Im trying to read some data from a NetCDF file with a rotated coordinate
system using the function retrieve.nc() from the clim.pact package. I know,
that the rotated pole is supposed to be at 198.0 E and 39.25 N, the top left
corner is at 331.79 E and 21.67 N. The grid resolution is 0.44°x0.44°
> There are two reasons. First is that in the "day_of_week", the starting day is
> Friday so if you plot a graph, the left most column will start with Friday.
> You
> may like to start the column with Monday.
Plotting levels in a particular order by default does not usually require an
ordered f
Cynthia Tedore biol.lu.se> writes:
>
> males is a factor. If I don't specify that, then it
> treats it as a numeric.
> any other suggestions?
transform(spiders,focal.chel=as.numeric(focal.chel),
opponent.chel=as.numeric(opponent.chel),fmales=factor(males))
model1<-lmer(threatened~focal
We don't do homework assignments on the list, but one answer
requires no loops and an understanding of the various ways R
uses vectors for indexing:
?"["
-
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352
-Orig
Dear All,
I tried to compile httpuv_1.2.0 and got a lot of errors. See below.
Compiling 1.0.6.3 was successful, but I need the latest version for "shiny".
Any ideas ?
Kind regards
Hans
amur1:root> R CMD INSTALL .
* installing to library '/usr/local/lib/R/library'
* installing *source* packag
I'm trying to write a function that will generate a NxN matrix that has
the value K on both diagonals, while the values outside the diagonals
(up and down) are 1's (for conflicting positions such as [4,5] and [5,4]
the larger value is written in the matrix). Basically, I'm trying to
replicate t
males is a factor. If I don't specify that, then it treats it as a numeric.
any other suggestions?
On Tue, Dec 3, 2013 at 11:25 AM, Pascal Oettli wrote:
> Hello,
>
> I get a result if I change 'as.factor(males)' to 'males'.
>
> Hope this helps,
> Pascal
>
> On 3 December 2013 18:43, Cynthia Ted
Hi,
There are two reasons. First is that in the "day_of_week", the starting day
is Friday so if you plot a graph, the left most column will start with
Friday. You may like to start the column with Monday. The second reason is
that instead of having all these long factor names (Monday,...), the cod
Hi everyone,
I'd like to replace the empty cells from a numerical variable (let's say
variable "AAA") with zero in multiple dataframes using "plyr" package.
Of course all the dataframes have the same structure but different
number of lines.
I've been trying variations of:
|dataset <- list.fil
Pascal Oettli ymail.com> writes:
>
> Hello,
>
> I get a result if I change 'as.factor(males)' to 'males'.
>
> Hope this helps,
> Pascal
>
> On 3 December 2013 18:43, Cynthia Tedore biol.lu.se>
> wrote:
> > I am able to use lmer on an older computer without this error, but the new
> > versio
On 03 Dec 2013, at 01:08 , David Gwenzi wrote:
> Dear all
>
> I have observations done in 4 different classes and the between classes
> *variance* is too high that I decided to run a model without pooling the
> *variance*. I used the following code first :
> model<-lm(y~x+fact
Am 02.12.2013 21:28, schrieb David Winsemius:
In fact you can set that globally with: ?options
options()$OutDec # my setting
[1] "."
Oh sorry I thought you mentioned to set excel globally to dot.
no change when setting it to dot. I seems that XLConnect is not able to
deal with NA in Excel,
A better solution to this problem is to use character indexing:
x <- c("Tuesday", "Thursday", "Sunday")
c(Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5,
Saturday = 6, Sunday = 7)[x]
http://adv-r.had.co.nz/Subsetting.html#lookup-tables-character-subsetting
Hadley
On Mon, Dec 2
here it is an amended (more general) version
library(randomForest)
set.seed(1)
data(iris)
iris.rf <- randomForest(Species ~ ., iris, proximity=TRUE, keep.forest=TRUE)
x<-MDSplot(iris.rf, iris$Species)
#add legend
legend("topleft", legend=levels(iris.rf$predicted),
fill=brewer.pal(length(levels(
On Tue, Dec 03, 2013 at 02:42:42PM +0300, Charles Thuo wrote:
> what is the purpose of the subject function
please see rule #6 of "Ten Simple Rules for Reproducible Computational
Research" [Sandve et.al., PLoS Comput Biol 9(10): e1003285
doi:10.1371/journal.pcbi.1003285]
Can't resist this opportu
To start a random sequence that can be reproduced later. The particular seed
value used should not be important unless either the random number generator or
the computations that use the random numbers are flawed.
?set.seed
http://en.m.wikipedia.org/wiki/Pseudorandom_number_generator
-
Seriously?
You should be ashamed of yourself for even considering posting a question
like this.
Charles Thuo wrote
> what is the purpose of the subject function
>
> Charles
>
> [[alternative HTML version deleted]]
>
> __
> R-help@
> mailin
Pretty much nothing can convert arbitrary PDF files to unicode. It depends a
lot on what is in the PDF to begin with -- properly encoded text or just
bitmapped images, for example.
I would recommend you search around to see whether there's a related
archive in a different format.
And in any cas
There are a few remaining places on the following course:
Data exploration, regression, GLM and GAM with introduction to R
When: 3 - 7 February, 2014
Where: University of Coimbra, Coimbra, Portugal
Further information: http://www.highstat.com/statscourse.htm
Flyer: http://www.highstat.com/Cour
Hi,
backsolve() is probably what you are looking for.
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Michael Meyer
Sent: 03 December 2013 12:25
To: r-help@r-project.org
Subject: [R] triangular matrix inverse
Greetings,
Greetings,
is there an algorithm which computes the inverse of a triangular matrix
while being aware of its triangular form?
I know about solve() but this is probably not efficient on a triangular matrix.
Thanks,
Michael Meyer
[[alternative HTML version deleted]]
___
what is the purpose of the subject function
Charles
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.h
sorry, in fact it was a trivial question!
by just peeping into the function I've worked out this simple solution:
MDSplot(iris.rf, iris$Species)
legend("topleft", legend=levels(iris$Species), fill=brewer.pal(3, "Set1"))
thank you
> thanks andy
>
> it's a real honour form me to get a reply by yo
Dear Rolf,
I've started trying to understand your issue but it may take me some
time as I'm rather busy within the next few days. However, if you can
put the screen capture on an external web site, that would be great as
it would help decipher what kind of system the student used for
representing
Arun has given you a number of ways to do what you (seem to) want. If
this is fast enough, then you're done.
If not, then the key to speeding things up is to do things
differently. Note that a 1 x 9 matrix is a just a vector. Since each
element of the vector is a "different computation", apparentl
Hello,
I get a result if I change 'as.factor(males)' to 'males'.
Hope this helps,
Pascal
On 3 December 2013 18:43, Cynthia Tedore wrote:
> I am able to use lmer on an older computer without this error, but the new
> version (downloaded yesterday) gives me this error message:
>
> Error in [[<-.d
I have a similar problem that I need to solve. I need to be able to
visualise a Geological fault in 3-D. I need to interpolate the x y z data
and then visualise it on its side. Im not sure if or is capable of doing
this?
Thanks
On Tue, Dec 3, 2013 at 4:02 AM, Mercutio Florid wrote:
> I want to
I am able to use lmer on an older computer without this error, but the new
version (downloaded yesterday) gives me this error message:
Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0
rows, data has 117
in response to this function:
model1<-lmer(threatened~as.numeric(fo
HI,
May be this helps:
example <- function(X,n){
lst1 <- list()
for(i in 1:n){
cell1 <- sample(X,1)
cell2 <- sample(X,1)
table1 <- cbind(cell1,cell2)
lst1[[i]] <- table1
}
do.call(rbind,lst1)
}
#or
example1 <- function(X,n){
table1 <- vector()
for(i in 1:n){
cell1 <- sample(X,1)
cell2 <- sample
57 matches
Mail list logo