On Sep 11, 2013, at 5:05 PM, Ramona Lall wrote:
Hello all,
I am running mixed model on a large dataset and I get the following
warning messages:
Reached total allocation of 1535Mb: see help(memory.size)
and
Calloc could not allocate memory (705648 of 8 bytes)
How do I get around this?
Your solution is unnecessarily complicated. There is no need to convert
to data frames and no need to eval labels -- simple indexing by column and
row names will do. I think the following code is pretty self-explanatory:
(Starting with the same mat1 and mat2)
rnames -
On 12/09/2013 07:00, David Winsemius wrote:
On Sep 11, 2013, at 5:05 PM, Ramona Lall wrote:
Hello all,
I am running mixed model on a large dataset and I get the following
warning messages:
Reached total allocation of 1535Mb: see help(memory.size)
and
Calloc could not allocate memory (705648
v- read.csv(file=sales.csv,header=TRUE)
v
i get an output whose column names are V1,V2, and so on but i would like to
retain the original column names such as january through to december.
Charles.
[[alternative HTML version deleted]]
__
-- Forwarded message --
From: vikram ranga babuaw...@gmail.com
Date: Thu, Sep 12, 2013 at 1:02 PM
Subject: Re: [R] how to retain dimnames while exporting from excel into r
To: Charles Thuo tcmui...@gmail.com
On Thu, Sep 12, 2013 at 12:45 PM, Charles Thuo tcmui...@gmail.com wrote:
Hi,
the following code works:
plot(1,1, main=expression(paste(speed [, m * s^{-1}, ])))
I would, however, like to be able to supply the value speed and
m*s^{-a} by variables, e.g. do something like:
a = 'speed'
b = 'm*s^{-2}'
plot(1,1, main=expression(paste(a, [, b, ])))
This,
Hi,
Try with:
read.csv(file=sales.csv,header=TRUE,check.names=FALSE)
A.K.
- Original Message -
From: Charles Thuo tcmui...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Thursday, September 12, 2013 3:15 AM
Subject: [R] how to retain dimnames while exporting from excel into r
v-
Hi, Jannis,
maybe
plot( 1, 1, main = bquote( paste( .(a), [, .(b), ])))
comes close to what you want, but I think you may even have to use the
following to get a varying exponent really printed elevated:
a - speed
b - m * s
cc - -2
plot( 1, 1, main = bquote( paste( .(a), [,
Hi Gerrit,
Thank you very much for the precise explanation.
Syntactically, I thought R is smart enough to detect that I'm using one of the
columns because I use data=mytable syntax which means that input/output
information are in the mytable.
For a generic support, I think it's wise to
Hello!
I am using relatively simple linear model. By applying fastbw() on ols()
results from rms package I would like to get subtable Approximate Estimates
after Deleting Factors. However, it seems this is not possible. Am I right? I
can only get coefficients for variables kept in the model
Dear subscribers of r-help,
I would like to know your opinion about a privacy problem that I recently had
after publishing to this list. Not a long time ago, I requested to the
administrators of this list that they removed 2 or 3 old posts from mine. These
posts were associating my name with an
Hello!
Just a short question:
If you publish something, say a paper or book or report (in dead tree
format = on paper), do you ask libraries and owners of this publication
also to throw it away, because it is old or you have changed positions?
If in the academic world every scientist would
Hello all - does anyone know if there is a package in R that will allow me
to create a map of the US (or individual states) that uses the American
Community Survey PUMS boundaries?
Thanks
[[alternative HTML version deleted]]
__
Hi R-helpers,
Can anyone help me to give hints/packages to make a simple bar plot with
mean and standard error of variables (A, C F) that I'd like to plot in X
and the values in Y? The factor (sex) should be as legend (Male Female).
Actually, I'd prefer to have a plot like the attached Fig.
Hi Gerrit,
thanks for your suggestion. I want to create some code were I can supply
the 'm*s^{-2}' part as an argument to a function and which evaluates
this as an expression to use Rs mathematical annotation features in the
labels.
Any further ideas?
Jannis
On 12.09.2013 14:28, Gerrit
On 13-09-12 9:40 AM, John Gonzalez wrote:
Dear subscribers of r-help,
I would like to know your opinion about a privacy problem that I recently had
after publishing to this list. Not a long time ago, I requested to the
administrators of this list that they removed 2 or 3 old posts from mine.
Dear R People:
I have been experimenting with rPython, rSymPy, and rJython. Here is my
latest snag:
library(rJython)
Loading required package: rJava
Loading required package: rjson
library(rSymPy)
rJython - rJython()
x - x
y - y
rJython$exec(from sympy import *)
Error in
the smallest boundary in the 1-year acs files is public use microdata area
(puma), but the 3- and 5-year public use microdata samples (pums) go down
to some counties, i believe..
http://www.census.gov/acs/www/guidance_for_data_users/estimates/
i think you just need to download the census
What does this have to do with R?
Post on a statistics list,like stats.stackexchange.com instead, please.
Cheers,
Bert
On Thu, Sep 12, 2013 at 11:08 AM, Gary Dong pdxgary...@gmail.com wrote:
Dear R users,
I have a question regarding using logged ratio as dependent variable in
regression.
Not only are you asking the administrators of an email list to alter data
stored on systems other than the ones they control, you are suggesting that
they can somehow alter search records stored in Google's servers. At best you
are naive. That does not mean you are the only person with such
Hi,
res- ddply(.data=df1,
.variables='Taxa',
.fun=transform,
Class=find.class(Taxa))
#Warning messages:
#1: In grep(x, df2$Taxa) :
# argument 'pattern' has length 1 and only the first element will be used
#2: In grep(x, df2$Taxa) :
# argument 'pattern' has length 1 and only
Hello,
I would like to do a pca with princomp.
I have a dataset with different observations for each row and for different
variables for each column (test.z). If I understood it correctly this is
the way the data should be structured for princomp. But it does not work.
But if I transpose the
Hello -
I have imported timestamp data (collected in OpenSHAPA) into R as .csv
file. Some columns in the data frame have timestamps in the format
HH:MM:SS:sss. I have not found a package that will allow simple addition
and subtraction of columns with this format, although 'strptime' in
Paulito:
Just my opinion:
You wrote: Syntactically, I thought R is smart enough to detect that I'm
using one of the columns because I use data=mytable syntax which means that
input/output information are in the mytable.
You appear to be suggesting that R do something contrary to what is
I've got two data frames, as shown below:
(NR means Number of Record)
record.lenths
NR length
1 100
2 130
3 150
4 148
5 100
683
760
valida.records
NR factor
Hi,
I have a large dataframe that contains species names. I have a second
dataframe that contains species names and some additional info, called 'Class',
about each species. I would like match the species name is the first data
frame with the 'Class' information contained in the second.
Thanks Bert,
all predictors are numerical. By the way, I have checked the collinearity of
predictors by vif(). All vif of predictors were less than 2 that means none
of the predictors are linear combinations of the others.
Best,
Rose
--
View this message in context:
On Sep 12, 2013, at 13:42, Erin Hodgess erinm.hodg...@gmail.com wrote:
Dear R People:
I have been experimenting with rPython, rSymPy, and rJython. Here is my
latest snag:
library(rJython)
Loading required package: rJava
Loading required package: rjson
library(rSymPy)
rJython -
Use POSIXct for the date/time stamp. For your data you will have to
substitute a period ('.') for the last colon (:), but that is easy
to do with 'sub'.
You will get millisecond precision, but just barely; don't try for
microseconds since for that is the limit of precision with floating
point
try this:
record.length - read.table(text = NR length
+ 1 100
+ 2 130
+ 3 150
+ 4 148
+ 5 100
+ 683
+ 760, header = TRUE)
valida.records - read.table(text = NR factor
+ 1
If you want to find out if you've forgotten to make 'a' an argument
you can use codetools::findGlobals(func) to list the names that don't
refer to something already defined in the 'func':
fun - function(b) a + b
library(codetools)
findGlobals(fun)
[1] + a
You need to filter out things
For example:
a - 1
f - function(b){
return(a+b)
}
when we call function f(2), r will search the local environment first, if
it cannot find a, it will search global environment, and return 3. How to
avoid r searching the global environment and return an error when we call
this function?
Typo: in
environment(fun) - new.env(parent=parent.env())
the parent.env() should have been emptyenv(). But, as
I said, you do not want to do that.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org
Hello!
I am learning to use Shiny.
Imagine my ui.r file contains two different inputs that I can change:
sidebarPanel(
numericInput(input1, My input 1:, 5),
numericInput(input2, My input 2:, 10)
)
And I am generating (in server.r file) the sum of those two using
reactive({...
If I change
Hi,
Try:
string1- Red, Romeo, Calf
string2- Red, Rome, Ralf
string3- China, Japan, USA
gsub(R[[:alpha:]]{1,},MM,string3)
#[1] China, Japan, USA
gsub(R[[:alpha:]]{1,},MM,string2)
#[1] MM, MM, MM
gsub(R[[:alpha:]]{1,},MM,string1)
#[1] MM, MM, Calf
Other way would be:
Hi Bert,
Thanks for the explanation.
In R, it first search the local environment and then the parent environment
until the root environment (empty environment). I have a concern, when I
write a function, I may write a variable name wrong by typo. But by
coincidence,
this variable name is defined
On 12/09/2013 5:54 PM, Gang Peng wrote:
Hi Bill,
Thanks. I think we can define the function in the environment whose parent
environment is empty environment. But don't know how.
You can say environment(f) - emptyenv()
but then almost nothing will work. You wanted a+b. It won't know what
+
Hi Bill,
Thanks. I think we can define the function in the environment whose parent
environment is empty environment. But don't know how.
Best,
Mike
2013/9/12 William Dunlap wdun...@tibco.com
If you want to find out if you've forgotten to make 'a' an argument
you can use
On 12/09/2013 5:36 PM, Gang Peng wrote:
Hi Bert,
Thanks for the explanation.
In R, it first search the local environment and then the parent environment
until the root environment (empty environment). I have a concern, when I
write a function, I may write a variable name wrong by typo. But by
No No! The parent environment is **not necessarily** the enclosing
environment. The difference is crucial. R looks for free variables in the
enclosing, **not** the parent environment (although they are often the
same). Please read about lexical scoping in R in the R language
definition manual, or
You can do that with
environment(fun) - new.env(parent=parent.env())
but then your function, function(b)a+b, will not be able
to find the + function.
Putting this code into a package simplifies things a lot.
E.g., I added a file containing the two lines
phi - sum(1/(1:1e6)) - log(1e6) #
Hi,
You need to specify that a is an argument to the function:
On Thu, Sep 12, 2013 at 3:56 PM, Gang Peng michael.gang.p...@gmail.com wrote:
For example:
a - 1
f - function(b){
return(a+b)
}
f - function(b, a) {
return(a+b)
}
when we call function f(2), r will search the local
n.record - length(record.lenths$NR)
index - record.lenths$NR %in% valida.records$NR
tmp - 1:n.record
ind - tmp[index]
st - 1
skip - rep(0,length(ind))
for(i in 1:length(ind)){
if(stind[i]){
skip[i]-sum(record.lenths$
length[st:(ind[i]-1)])
}
st - ind[i]+1
}
2013/9/12 Zhang Weiwu
Hello everybody,
I used the function clogit() (package survival) to build a conditional logit
model. This is the R output of my model :
coef exp(coef) se(coef) robust se z
Pr(|z|)
anthro 2.14776 8.56565 0.09352 0.53989 3.978 6.94e-05 ***
cor 0.92365 2.51846 0.07757 0.41944 2.202
Michael and Sarah:
1. Actually the original claim -- that R will search the global environment
if it does not find a free variable in the function environment -- is not
strictly true. It will search the function's enclosure and then on up the
tree of enclosures. In this case, the enclosure was
Dear R experts,
I am currently working on a rather simple tobit regression, where the
dependet variable is left-censored (0). I would like to apply a Tobit
regression and then use the parameters of this regression to make a
prediction with new data. The intention behind this is to do an
On 09/13/2013 12:48 AM, Moshiur Rahman wrote:
Hi R-helpers,
Can anyone help me to give hints/packages to make a simple bar plot with
mean and standard error of variables (A, C F) that I'd like to plot in X
and the values in Y? The factor (sex) should be as legend (Male Female).
Actually, I'd
Use the 'prcomp' function rather than 'princomp'. The help page for
'princomp' refers to 'prcomp' a couple of times, the last paragraph in the
details section says that 'princomp' requires at least as many units as
variables, then points to 'prcomp' as using the alternative method (which
does not
1. Yes it makes sense.
2. Use prcomp() instead. It will work with more variables than
observations.
-- Bert
On Thu, Sep 12, 2013 at 7:31 AM, Hermann Norpois hnorp...@gmail.com wrote:
Hello,
I would like to do a pca with princomp.
I have a dataset with different observations for each row
Jake,
You can use the plyr library or some form of apply. If you are on a 64bit
system you can multithread and it goes much faster.
something like this(for 32bit):
require(plyr)
df1 - data.frame(Taxa = c('blue', 'red', NA,'blue', 'red', NA,'blue', 'red',
NA))
df2 - data.frame(Taxa = c( 'blue',
On Sep 12, 2013, at 3:31 PM, Marine Regis wrote:
Hello everybody,
I used the function clogit() (package survival) to build a
conditional logit
model. This is the R output of my model :
coef exp(coef) se(coef) robust se z
Pr(|z|)
anthro 2.14776 8.56565 0.09352 0.53989 3.978 6.94e-05 ***
cor
On Sep 12, 2013, at 8:40 AM, John Gonzalez wrote:
Dear subscribers of r-help,
I would like to know your opinion about a privacy problem that I
recently had after publishing to this list. Not a long time ago,
I requested to the administrators of this list that they removed 2
or 3 old
Dear R users,
I have a question regarding using logged ratio as dependent variable in
regression. I am reading a paper discussing how a waste management facility
has influenced housing price in surrounding areas. The author used
Ln(P2/P1) as the dependent variable, where P1 and P2 represent trade
I have the following experience.
If I use, for example,
tmp - recordPlot()
in a session, then immediately the saved plot replays successfully using
replayPlot()
in the same session. But not in the next R session. See examples below,
copy/pasted from my shell window.
The first R session is
Hi,
I want to cluster my data points into K clusters using k-means algorithm,
and I want to use a deterministic (non-random) initialization scheme which
is also a good start. I found a paper by Ting Su and Jennifer Dy named A
Deterministic Method for Initializing K-means Clustering and I wonder
HI,
May be this helps:
record.length - read.table(text = NR length
1 100
2 130
3 150
4 148
5 100
6 83
7 60, sep=,header = TRUE)
valida.records - read.table(text = NR factor
1 3
I see. Thanks a lot for your help.
M.
2013/9/12 Bert Gunter gunter.ber...@gene.com
No No! The parent environment is **not necessarily** the enclosing
environment. The difference is crucial. R looks for free variables in the
enclosing, **not** the parent environment (although they are often
I am using a similar dataset to the following:
a= c(Fruits, Adam,errorA, steve, errorS,
apples, 17.1,2.22, 3.2,1.1,
oranges, 3.1,2.55, 18.1,3.2 )
a_table=data.matrix(t(matrix(a,nrow=5)))
I would like to plus minus every second column starting from errorA (using
xtable/ hmisc)
example
I thought '+' was defined in a more basic level. I usually use CPP. R is
very different from CPP in many basic concepts.
M.
2013/9/12 William Dunlap wdun...@tibco.com
Typo: in
environment(fun) - new.env(parent=parent.env())
the parent.env() should have been emptyenv(). But, as
I said,
Hi,
Try:
a_table[grep(\\d+,a_table)]- paste0(a_table[grep(\\d+,a_table)],$\\pm$)
library(xtable)
print(xtable(a_table),sanitize.text.function=identity)
% latex table generated in R 3.0.1 by xtable 1.7-1 package
% Thu Sep 12 21:26:45 2013
\begin{table}[ht]
\centering
\begin{tabular}{rl}
On 13-09-11 07:06 PM, Ben Harrison wrote:
If I were Michael (OP) right now, I think my head would be spinning.
As a newbie myself, I know how hard it is to read R code for the first
time, so could it also be part of the newsgroup etiquette to at least
partially explain provided code to
Is this what you want?
myTitle - function (name, unitsExpr = parse(text = unitsString)[[1]],
unitsString)
{
name - as.name(name)
bquote(.(name) ~ [ * .(unitsExpr) * ])
}
plot(1,1,xlab=myTitle(velocity, quote(km/hr)), ylab=myTitle(distance,
quote(light~years)))
Note that unitsExpr
I would like to know your opinion about a privacy problem that I recently had
after publishing to this list.
Well, in short, you appear to have wilfully ignored the terms of membership of
the list, posted intentionally on a public mailing list without checking where
the posts would end up,
I have 8 predictors and 1144 observations over 13 years. I think it is not
the case.
--
View this message in context:
http://r.789695.n4.nabble.com/computationaly-singular-error-tp4675810p4675962.html
Sent from the R help mailing list archive at Nabble.com.
Error in solve.default(H, g[!fixed]) :
system is computationally singular: reciprocal condition number =
4.65795e-19
Maybe you have more predictors than data?
S Ellison
***
This email and any attachments are
... or some of the predictors are (near) linear combinations of others.
This often occurs when some of the predictors are categorical/factors with
lots of levels.
Cheers,
Bert
On Thu, Sep 12, 2013 at 8:45 AM, S Ellison s.elli...@lgcgroup.com wrote:
Error in solve.default(H, g[!fixed]) :
At 18:51 11/09/2013, petre...@unina.it wrote:
r-help@r-project.org
Dear all,
I use R 2.15.2 for Windows 8
I ask if it is possible perform a meta-analysis of annualized event
rate from several studies reporting
Try metafor (from CRAN)
Look in the help for escalc for incidence rate ratio
Hi,
Also:
a_table[grep(\\d+,a_table)]-paste0(sprintf(%.2f,as.numeric(a_table[grep(\\d+,a_table)])),$\\pm$)
# 2 d.p.
print(xtable(a_table),sanitize.text.function=identity)
A.K.
- Original Message -
From: arun smartpink...@yahoo.com
To: Sachinthaka Abeywardana
Here is a start
a= c(Fruits, Adam,errorA, steve, errorS,
apples, 17.1,2.22, 3.2,1.1,
oranges, 3.1,2.55, 18.1,3.2 )
a_table=data.matrix(t(matrix(a,nrow=5)))
# restructure data
ahead = a_table[1,]
atab - data.frame(a_table[-1,])
for (j in 2:5) atab[,j]=trunc(as.numeric(atab[,j]))
HI,
Sorry, there was a mistake as I didn't properly looked at the output you wanted.
a_tableNew- data.matrix(matrix(0,3,3))
a_tableNew[2:3,2:3]-paste0(sprintf(%.2f,as.numeric(
a_table[,seq(2,5,2)][grep(\\d+,a_table[,seq(2,5,2)])])),$\\pm$,sprintf(%.2f,as.numeric(
Hello everybody,
Thank you David for your answer. Sorry I am beginner with cox model and R
software. Is it possible to do predictions from newdata which has a size equal
to the vector hour - seq(0,23.99,0.1) ? In fact, I don't know how to define
parameters cluster and strata in the newdata
It is a nice surprise to wake up receiving three answers, all producing
correct results. Many thanks to all of you.
Jim Holtman solved it with amazing clarity. Gang Peng using a traditioanl
C-like pointer style and Arun with awesome tight code thanks to diff().
I am embrassed to see my
Hi,
rownames(y_raw_mt)=y_raw[,1] ## y_raw not defined.
set.seed(25)
mat1- matrix(sample(c(NA,1:20),100,replace=TRUE),20,5)
#changed the function to process 'mat1'. Also, it is better to read the file
separately and check ?str(dt.table) before proceeding.
write.table1=function(durty_data){
73 matches
Mail list logo