http://fiorentiniw.altervista.org/4zrqlf.php
__
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.html
and provide commented, minimal, self-contained, re
As others have said, your goal is unclear to us. However, one guess I have not
seen others make is if you are looking for a way to normalize within each
group, perhaps you should look at
?ave
which typically creates a vector just as long as your data vector and grouping
vector.
---
HI,
Not sure if this is what you meant.
tapply(iris$Sepal.Length,iris$Species,FUN=function(x)
sum(x)/sum(iris$Sepal.Length)*100)
# setosa versicolor virginica
# 28.55676 33.86195 37.58129
A.K.
- Original Message -
From: Karine Charlebois
To: "r-help@r-project.org"
Cc:
Sen
On Jan 15, 2013, at 6:30 PM, Karine Charlebois wrote:
> Dear all, I'd like to get a percentage variable based on a group, but without
> creating a new data frame.
> For example:
> data(iris)
>
> iris$percent <-unlist(tapply(iris$Sepal.Length,iris$Species,function(x)
> x/sum(x, na.rm=TRUE)))
Dear all, I'd like to get a percentage variable based on a group, but without
creating a new data frame.
For example:
data(iris)
iris$percent <-unlist(tapply(iris$Sepal.Length,iris$Species,function(x)
x/sum(x, na.rm=TRUE)))
This does not work, I should have only three standard values, respecti
David Winsemius wrote
> On Jan 15, 2013, at 3:25 PM, Pete Brecknock wrote:
>
>> David Winsemius wrote
>>> On Jan 15, 2013, at 2:49 PM, Pete Brecknock wrote:
>>>
Any recommendations for how I can embed my title below in a single red
strip/box across the plot area in the outer margin?
>>
On 01/15/2013 08:04 AM, Duncan Murdoch wrote:
I've never understood why Microsoft thinks it is good to display
incomplete filenames. This practice causes so many problems.
Personally, I never understand "Why Microsoft?".
cheers,
Rolf Turner
On Jan 15, 2013, at 3:25 PM, Pete Brecknock wrote:
> David Winsemius wrote
>> On Jan 15, 2013, at 2:49 PM, Pete Brecknock wrote:
>>
>>> Any recommendations for how I can embed my title below in a single red
>>> strip/box across the plot area in the outer margin?
>>>
>>> I would like to avoid t
David Winsemius wrote
> On Jan 15, 2013, at 2:49 PM, Pete Brecknock wrote:
>
>> Any recommendations for how I can embed my title below in a single red
>> strip/box across the plot area in the outer margin?
>>
>> I would like to avoid the color appearing in any other area defined by
>> the
>> oma
Ista,
Thank you. That more or less did the trick. I got the data though it's in a
weird format compared to how it appears on the page and needs a lot of clean
up. But I was kind of expecting that.
Dan
-Original Message-
From: Ista Zahn [mailto:istaz...@gmail.com]
Sent: Tuesday, Januar
Hi Dan,
On Tue, Jan 15, 2013 at 5:31 PM, Lopez, Dan wrote:
> Hi Ista,
>
> It does exist. It’s a page in our company intranet.
Ah, good.
>
> It is https so it looks like I can't use RCurl either. I tried RCurl BTW and
> got the below error.
>
Well that error is not because RCurl doesn't work w
On Jan 15, 2013, at 2:49 PM, Pete Brecknock wrote:
> Any recommendations for how I can embed my title below in a single red
> strip/box across the plot area in the outer margin?
>
> I would like to avoid the color appearing in any other area defined by the
> oma.
>
The code used "blue" ... not
On Mon, 2013-01-14 at 13:08 -0800, Ross Boylan wrote:
> Is there an easy way to identify all the functions called as a result of
> invoking a function? Getting the calling hierarchy too would be nice,
> but is definitely not essential.
>
> I'm trying to understand someone else's package, which is
David,
Because there is some data on various webpages that I use periodically that
this would be convenient for me to use.
Copying and pasting is messy . And obtaining direct database access for the
data on some these pages is not possible for me (i.e. won't get approved...but
I can use what is
On Jan 15, 2013, at 2:31 PM, Lopez, Dan wrote:
> Hi Ista,
>
> It does exist. It’s a page in our company intranet.
>
> It is https so it looks like I can't use RCurl either. I tried RCurl BTW and
> got the below error.
>
> Do you have experience with pulling a table of an https site? If so how
Hi,
Try this:
The last part was not clear.
A.df<-read.table(text="
a c 0.9
b x 0.8
b z 0.5
c y 0.9
c x 0.7
c z 0.6
",sep="",header=FALSE,stringsAsFactors=FALSE)
lst1<-split(A.df[,-1],A.df$V1)
lst1
#$a
# V2 V3
#1 c 0.9
#
#$b
#
I am getting the error message:
> library(Rcmdr)
Loading required package: car
Loading required package: MASS
Loading required package: nnet
Error : .onAttach failed in attachNamespace() for 'Rcmdr', details:
call: structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class =
"tclOb
Any recommendations for how I can embed my title below in a single red
strip/box across the plot area in the outer margin?
I would like to avoid the color appearing in any other area defined by the
oma.
# Example Plot
par(mfrow=c(2,2),mar=c(4,4,2,2), oma = c(1, 1, 3, 1))
plot(rnorm(100),1:100)
p
Hi Ista,
It does exist. It’s a page in our company intranet.
It is https so it looks like I can't use RCurl either. I tried RCurl BTW and
got the below error.
Do you have experience with pulling a table of an https site? If so how do I do
that?
> tabs <-
> readHTMLTable(getURL("https://hr-
This is fairly straight forward, you can do something like:
myfiles <- scan('files.txt', what="")
base <- sub("\\.[^.]*$", "", myfiles)
lapply( seq_along(myfiles), function(i) {
mydat <- read.table( myfiles[i] )
sink( sprintf('%sSummary.txt', base[i]) )
summary(mydat)
sink()
b
HI,
vec1<-"'asd'f"
vec2<-'"asd"f'
gsub("[\"]","",vec2)
#[1] "asdf"
gsub("[']","",vec1)
#[1] "asdf"
A.K.
- Original Message -
From: Christofer Bogaso
To: r-help
Cc:
Sent: Tuesday, January 15, 2013 4:38 PM
Subject: [R] Regular expression
Hello again,
I am having a problem on Regu
Hello,
Does anyone knows if there is a Documentation or any wiki that
could help me to configure and build R
using cygwin with the Intel Compilers on Windows?
Thanks,
Humberto.
[[alternative HTML version
i think this is what you want.. :)
http://stackoverflow.com/questions/4765936/using-joined-tables-to-exclude-certain-records
library(sqldf)
# use the mtcars example table
mtcars
# keep the first eight records in a second, separate data set
x <- mtcars[ 1:8 , ]
# keep all the records from mtca
Hi,
You could also do this:
res1<-do.call(rbind,lapply(xaulist,function(x)
as.numeric(apply(t(mapply(`==`,tata,x)),2,any
identical(res1,tutu)
#[1] TRUE
A.K.
- Original Message -
From: Biau David
To: r help list
Cc:
Sent: Tuesday, January 15, 2013 2:41 PM
Subject: [R] removing
On Jan 15, 2013, at 9:10 AM, Nuri Alpay Temiz wrote:
> Hi everyone,
>
> I have a question on selecting and grouping elements of a data frame. For
> example:
>
> A.df<- [ a c 0.9
> b x 0.8
> b z 0.5
> c y 0.9
> c x 0.7
> c z 0.6]
Tha
Hi,
May be this helps:
res<-do.call(rbind,lapply(xaulist,function(x)
as.integer(apply(tata,1,function(i) any(i==x)
res[]<-sapply(res,as.numeric)
identical(res,tutu)
#[1] TRUE
A.K.
- Original Message -
From: Biau David
To: r help list
Cc:
Sent: Tuesday, January 15, 2013 2:41 PM
>> gsub("[',"]", "", "'asd'f")
>Error: unexpected ']' in "gsub("[',"]"
>
>What is the right way to include the 'double quote' in the search field?
The 'search field' is a string and to put a double quote into a double-quote
delimited string you need to escape it with a backslash so it is not
inter
I am trying to exclude integer values from a small data frame 1, d1 that
have matching hits in data frame 2, d2 (Very big) which involves matching
those hits first. I am trying to use sqldf on the df's in the following
fashion:
df1:
V1
12675
14753
16222
18765
df2: head(df2)
V1 V2
13
Hi Dan,
A couple of things: first, I think that file really does not exist (at
least I can't open it in my web browser). Second, even if it did,
url() cannot download from https, according to the details section of
?url, which points you to RCurl. So, once you verify that you url
actually exists y
There is also the my.symbols and ms.polygon functions in the TeachingDemos
package that have syntax similar to the symbols function:
library(TeachingDemos)
x <- runif(10)
y <- rnorm(10)
my.symbols(x, y, ms.polygon, inches=0.3, n=400, add=FALSE, lty=3)
On Sat, Jan 12, 2013 at 7:42 PM, Ved P.
andrewH skreiv:
> Is there a data frame analog to sparse matrices? I am working with a panel
> data set that has a large number of variables that are redefined
> repeatedly or exist for only a few years (out of 48). In my current
> structure, where variables are columns and rows are years, more t
I am accustomed to the LIBSVM package, which provides cross-validation
on training with the -v option
% svm-train -v 5 ...
This does 5 fold cross validation while building the model and avoids
over-fitting.
But I don't see how to accomplish that in the e1071 package. (I
learned that svm(... c
Hi everyone,
I have a question on selecting and grouping elements of a data frame. For
example:
A.df<- [ a c 0.9
b x 0.8
b z 0.5
c y 0.9
c x 0.7
c z 0.6]
I want to create a list of a data frame that gives me the unique values of
Hi,
I am using XML::readHTMLTable and getting the below error. Does anyone know
why? Does this function not work with https? I didn't see anything in help
about that.
> library(XML)
> wampage<-readHTMLTable('https://hr-workforce-analytics.llnl.gov/wf_pi_pop.html',1)
Error in htmlParse(doc) :
Andrew,
That did the trick.
Thank you.
Dan
From: Andrew Robinson [mailto:mensuration...@gmail.com]
Sent: Monday, January 14, 2013 6:06 PM
To: Lopez, Dan
Cc: R help (r-help@r-project.org)
Subject: Re: [R] Random Forest Error for Factor to Character column
After you subset the data, did you redec
Dear all,
I am working on an author network and to do so I have to arrange a data.frame
(tutu) crossing author names (rows) per publication number (column). The
participation of the author to a study is indicated by a 1 and 0 otherwise.
I have a vector (xaulist) of all the names of authors and
Use shell() instead of system(). E.g., I have a bunch of Unix-like
executables in c:\cygwin\bin and I can use pipe and redirection
signs with them using shell():
> tf <- tempfile()
> file.exists(tf)
[1] FALSE
> shell(paste("c:\\cygwin\\bin\\ls | c:\\cygwin\\bin\\head -5 >", shQuote(tf,
> "cmd"))
Hi all --
I am working on 64-bit Windows XP. I'm not a very technical person when it
comes to the command line stuff, so please forgive me if this is a stupid
question.
I have a bunch of HDF files, and I want to dump a single PM25 data layer
from each file to .txt by invoking ncdump.exe from sys
Thanks for the suggested code! It’s a very nice way of displaying most
aspects of the data and the HSD tests/CIs. The graphical display is
probably to big for inclusion in journal articles, but works well for
displaying the results when working with the data.
Regards,
Karl Ove Hufthammer
ty. de
On Jan 15, 2013, at 8:16 AM, Benjamin Gillespie wrote:
Hi all,
Thanks in advance for any help.
I have a vector "b":
b=c(1,1,1,2,3,4,3,2,1,1,1,1,1,2,3,4,5,4,3.5,3,2,1,1,1)
Imagine b is river flow throughout time.
I would like some code that will generate the following information:
number o
Hello,
Continuing Jessica's code, to get the maximum of each group just use
b <- c(1,1,1,2,3,4,3,2,1,1,1,1,1,2,3,4,5,4,3.5,3,2,1,1,1)
r <- rle(b > 1)
groups <- rep(1:length(r$lengths),r$lengths)
tapply(b, groups, FUN = max)
# To get just the groups where b > 1,
mx <- tapply(b, groups, FUN = m
You should read the help for hist carefully:
?hist.Date
hist has very specific rules for applying breaks that are often different than
tabulation (tapply or aggregate, with or without using the cut function first).
---
Jeff
Dear Folks--
Is there a data frame analog to sparse matrices? I am working with a panel
data set that has a large number of variables that are redefined repeatedly
or exist for only a few years (out of 48). In my current structure, where
variables are columns and rows are years, more than 90 perce
On 15.01.2013 12:35, Julie Collet wrote:
Dear all,
I'd like to remove the space between the x-axis and the 0 of the y-axis in the
hist function.
I saw the previous post
https://stat.ethz.ch/pipermail/r-help/2012-September/324177.html suggesting
adding the x-axis at position 0 (or the lowest
Thanks everyone,
I've used the code Will supplied - this worked well.
Thanks to all the others who contributed.
Ben Gillespie
Research Postgraduate
School of Geography
University of Leeds
Leeds
LS2 9JT
Tel: +44(0)113 34 33345
Mob: +44(0)770 868 7641
http://www.geog.leeds.ac.uk/
___
If all you want is frequencies, could you use table()?
dd <- c("2001-01-02", "2001-01-02", "2001-01-02", "2001-01-02",
"2001-01-02", "2001-01-02", "2001-01-02", "2001-01-02", "2001-01-02",
"2001-01-03", "2001-01-03", "2001-01-03", "2001-01-03", "2001-01-03",
"2001-01-03", "2001-01-03", "2001-01-0
Geraldine:
On Tue, Jan 15, 2013 at 1:51 AM, Geraldine Werhahn wrote:
> Dear All,
>
> I have fitted generalized linear models with the glm() function from the
> package lme4. The statistical values it returns are the z-value and the
> p-value. Now I am searching for a way to get the F-values for
I don't know of any tools within R to do something like this, but one
possibility is to use other software that will interface with your device
and can then talk with R, one possibility for an intermediate program is
here: http://www.windmill.co.uk/index.html.
On Fri, Jan 11, 2013 at 4:41 PM, Mar
Hi,
Check these links:
http://comments.gmane.org/gmane.comp.lang.r.ggplot2/6527
https://groups.google.com/forum/#!msg/ggplot2/nfVjxL0DXnY/5zf50zCeZuMJ
A.K.
From: Usha Gurunathan
To: arun
Cc: R help
Sent: Tuesday, January 15, 2013 6:31 AM
Subject: Re: [R] ran
HI,
In this case, all the elements in Dat$att are found in Replace.
Dat1<-within(Dat,{att<-as.character(att)})
vec1<-unlist(lapply(strsplit(Dat1$att,""),unique))
vec1
#[1] "b" "b" "b" "d" "b" "b" "a" "c" "a" "d" "a" "b" "b" "b" "b" "d" "b" "b"
"d"
#[20] "b"
Dat1[5:7,2]<-c("uu","tt","vv")
vec1<
Dear all,
I'd like to remove the space between the x-axis and the 0 of the y-axis in the
hist function.
I saw the previous post
https://stat.ethz.ch/pipermail/r-help/2012-September/324177.html suggesting
adding the x-axis at position 0 (or the lowest value of y) after making the
histogram. Unf
Dear All,
I have fitted generalized linear models with the glm() function from the
package lme4. The statistical values it returns are the z-value and the
p-value. Now I am searching for a way to get the F-values for my models to use
for reporting - as to my knowledge reporting z-values is no
Dear R_help
list members!
Â
Iâm
studding forest carnivores and I have data on resting site selection and use!
Â
Iâm trying
to model the probability that a forest carnivore might have in be located in a
tree hollow (1) (the main resting site selected) rather than elsewhere (0)
(other resting s
Hello R-Helpers,
I would like to generate the frequencies of dates (data.RData).
str(data)
Date[1:43748], format: "2001-01-01" "2001-01-01" "2001-01-01" "2001-01-01"
...
test <- hist(data,"days",freq=T)
> test$counts
[1] 27 17 12 15 6 4 5 13 5 13 15 9 7 10 11 21 10 10 9 11 15 7 10
Maybe rle can help a little here
rle(b>1)
Run Length Encoding
lengths: int [1:5] 3 5 5 8 3
values : logi [1:5] FALSE TRUE FALSE TRUE FALSE
r<-rle(b>1)
r$lengths[r$values]
[1] 5 8
# started for the maximum but need to go home now, sorry. Will continue
tomorrow if noone else finishes it.
g
Hi Ben
I'm not sure whether I understood correctly, but is it something like this?
> sum(ifelse(b==2,1,0))
[1] 4
> sum(ifelse(b==3,1,0))
[1] 4
> sum(ifelse(b>=2,1,0))
[1] 13
> sum(ifelse(b>2,1,0))
[1] 9
Etc...
José
José Iparraguirre
Chief Economist
Age UK
-Original Message-
From: r-h
I don't completely understand the question, but if you are looking
for the lengths of the runs of values greater than 1 then rle() would
help:
> b <- c(1,1,1,2,3,4,3,2,1,1,1,1,1,2,3,4,5,4,3.5,3,2,1,1,1)
> r <- rle(b>1)
> r
Run Length Encoding
lengths: int [1:5] 3 5 5 8 3
values : l
I don't know if I understand what you want. What are the periods? I
suspect this is a time series. What have you tried that didn't work?
kind regards,
Stephen
On 01/15/2013 10:16 AM, Benjamin Gillespie wrote:
Hi all,
Thanks in advance for any help.
I have a vector "b":
b=c(1,1,1,2,3,4,3,
Hi all,
Thanks in advance for any help.
I have a vector "b":
b=c(1,1,1,2,3,4,3,2,1,1,1,1,1,2,3,4,5,4,3.5,3,2,1,1,1)
Imagine b is river flow throughout time.
I would like some code that will generate the following information:
number of individual 'periods' where b>1 (= 2 in this case)
period
Many thanks, I got this to work.
On 15/01/2013 12:57, John Laing wrote:
> Tolga,
>
> The Rbbg binary for 2.15 works for the .0, .1, and .2 minor versions.
> The issue here is probably a change to the install.packages function
> that was introduced in R 2.15.2. You can get around this by first ca
HI all:
I have a customized source reader for the package tm (that Milan Bouchet-Vallat
has been instrumental in producing).
I can get it to produce a corpus of class:
"VCorpus" "Corpus" "list"
class(mycorp[1]) returns
"VCorpus" "Corpus" "list"
and class(mycorp[[1]] returns
"PlainTextD
Hi,
I actually need to download pdfs through R code.
The thing which I want to do is that, search for a paper in pubmed,
which is possible by using GetPubMed function in the package "NCBI2R’".
GetPubMed(searchterm, file = "", download = TRUE , showurl = FALSE,
xldiv = ";", hyper = "HYPERLIN
list.files() to get all the files in the directory (use the pattern
argument to be more specific). Then loop over the file names, reading
in the data one at a time, do the desired processing, and then use the
file name to make the graphics file name as well.
Cheers, MW
On Tue, Jan 15, 2013 at 12:
Tolga,
The Rbbg binary for 2.15 works for the .0, .1, and .2 minor versions. The
issue here is probably a change to the install.packages function that was
introduced in R 2.15.2. You can get around this by first calling
R> options(install.packages.check.source = "no")
and then following with the
Dear R users,
First of all I would like to thank all of you who replayed to my previous
questions and problems. Thank you a lot for being great and helpful
community. I highly appreciate your suggestions and ideas even if I do not
respond after my question! But it means that your help was exactly
Karl,
I will look at your function later and comment on it.
RIght now, I am replying to your comment "The levels should preferably be
ordered by the group means, "
One of the features of the tabular printout from the mmc function, and of
both
the MMC plot and the plotMatchMMC plot, is that t
Den 2013-01-14 19:58 skreiv Richard M. Heiberger:
Please look at the MMC (Mean-mean Multiple Comparisons) plot in the
HH package.
It displays both the means and the differences.
install.packages("HH") ## if you don't already have it.
library(HH)
?MMC
I have now coded a very quick-and-dirty so
Karl,
Thank you for this interesting challenge. It turns out to be reasonably
straightforward.
This code does it for the first example in ?MMC.
## This example is based on the example in ?HH:::MMC
library(HH)
## pairwise comparisons
data(catalystm)
## A. individual plots
## base graphics bo
Hi AK
Got an error message with
library(ggplot2)>
ggplot(BP.stack1,aes(x=factor(HiBP),fill=Obese))+geom_bar(position="fill")Error
in rename(x, .base_to_ggplot, warn_missing = FALSE) :
could not find function "revalue">
ggplot(BP.stack1,aes(x=factor(HiBP),fill=Overweight))+geom_bar(position="fil
Thanks, that makes it clear
-Original Message-
From: Pascal Oettli [mailto:kri...@ymail.com]
Sent: Tuesday, January 15, 2013 1:07 PM
To: Pancho Mulongeni
Cc: R help
Subject: Re: [R] Removing an attached object
Hi,
Please read the following:
http://stackoverflow.com/questions/3536036/rm
Hi,
Please read the following:
http://stackoverflow.com/questions/3536036/rmlist-ls-doesnt-completely-clear-the-workspace
HTH,
Pascal
Le 15/01/2013 19:55, Pancho Mulongeni a écrit :
Dear All,
I am a bit confused, I attached my data frame using 'attach(DATA)'
Then I removed it using 'rm(DATA)
Dear All,
I am a bit confused, I attached my data frame using 'attach(DATA)'
Then I removed it using 'rm(DATA)'
But for some reason it is still at position 2 at the search path
search()
[1] ".GlobalEnv""DATA" "package:foreign"
[4] "package:stats" "package:graphics" "pa
Hi,
If you only need "aa" to be replaced by "a", "bb" by "b" and so on, try
the following:
Dat$att <- as.factor(substr(Dat$att,1,1))
HTH,
Pascal
Le 15/01/2013 18:48, Christofer Bogaso a écrit :
Dear all,
Let say I have following data-frame:
Dat <- structure(list(dat = c(-0.38779584295632
On 01/15/2013 04:06 PM, Karan Anand wrote:
Hi,
I have a graph where my y axis are scaled in the interval of 500 ,i
want to make them i the interval of 2,so pls can u help me out.
Hi karan,
This appears to be a nonsensical request, as you seem to be asking for
the number of tick marks on
On 14/01/2013 22:25, Hadley Wickham wrote:
I think codetools could do this reasonably well with the walkCode function,
but I've never done it so I don't have sample code, and walkCode is mostly
an internal function.
There are a couple of approaches here:
http://stackoverflow.com/questions/14276
Hi,
I have a graph where my y axis are scaled in the interval of 500 ,i
want to make them i the interval of 2,so pls can u help me out.
karan
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/m
On Mon, Jan 14, 2013 at 6:26 PM, Jonsson wrote:
> I have just contacted the sources and I am told that he checked min/max
> lat/lon for the file and it was right. He is using Linux while I am using
> Windows, would that be problematic?
gdalinfo on a Linux box says it has the same problem:
$ gdal
Thanks for trying it out, David. Unfortunately it isn't reproducible with a
machine with 64 Gb of RAM or more.
Yours,
Cyrus
On Mon, Jan 14, 2013 at 8:25 PM, David Winsemius wrote:
>
> On Jan 14, 2013, at 9:07 AM, Cyrus Shaoul wrote:
>
> > No, Mehmet, I haven't tried that yet. I was hoping to
78 matches
Mail list logo