Dear Duncan, dear Rui,
thanks for your replies. You are correct regarding the additional
paranthesis. I probably copied the wrong code. I, however, get this
inlinedocs error with the correct version. After contacting the package
maintainer I think this is now added to inlinedocs list of
Hi everybody!
I have a rather simple question:
# play data
persId-c(1,2,3,1,4,5,2)
varA-c(11,12,13,12,14,15,10)
df-as.data.frame(cbind(persId, varA))
Now I'd like to create a new columns (df$new)
according to the value of df$VarA. For example
df$new1 should be 1 if df$varA==2 or df$new2 should
Probably formatR/knitr is more robust but this one has an option for S
http://hilite.me/
-m
On 25 January 2013 02:37, C W tmrs...@gmail.com wrote:
I ran across this page for C, Java, etc. No R.
http://pastebin.com/
It looks similar and more than what I was looking for, just saying.
Mike
On Fri, Jan 25, 2013 at 6:11 AM, Ray Cheung ray1...@gmail.com wrote:
Dear Michael,
Thanks for your codes. However, lapply does not work in my case since I've
some files missing in the data (say, the file data101.dat). Do you have any
suggestions on this?? Thank you very much.
You could
Hi:
I use R 2.15.0 and RStudio 0.95.265. Platform: Windows 7 - 32b
When I predict some series with the x12 package (Version Number 0.3 Build
192) with the code...
forec - x12(serie, x12path=D:/WinX12/X12a/x12a.exe, decimals=5,
automdlT, outlier=all)
... where serie is this ts object:
dear all,
thank you for reading.
I have a dataset of artists and where and when they had an exhibition.
I'd like to create an affiliation network in the form of matrix, telling me
which aritist have been in the same at the same time.
I manage to do it, but given that I have 96000 observation
HI,
I have the array list:
X-vector(list, 2)
X[[1]] : data frame 1
X[[2]]: dataframe2
now i want to change index 1 and 2 into: 0-10 , 11-20 ,.
finally I want to have
X[[0-10]]:dataframe1
X[[11-20]]:dataframe2
how do I get them?
Thanks a lot.
Kind regards,
Tammy
names(X) - c(0-10, 11-20)
MW
On Fri, Jan 25, 2013 at 9:39 AM, Tammy Ma metal_lical...@live.com wrote:
HI,
I have the array list:
X-vector(list, 2)
X[[1]] : data frame 1
X[[2]]: dataframe2
now i want to change index 1 and 2 into: 0-10 , 11-20 ,.
finally I want to have
Hi Tammy,
Are you just looking for names()?
Not sure, but it can be troublesome to have - in a name.
HTH,
Ivan
--
Ivan CALANDRA
Université de Bourgogne
UMR CNRS/uB 6282 Biogéosciences
6 Boulevard Gabriel
21000 Dijon, FRANCE
+33(0)3.80.39.63.06
ivan.calan...@u-bourgogne.fr
Hi,
Not sure this is what you need, but what about list.files()?
It can get you all the files from a given folder, and you could then
work this list with regular expressions for example.
HTH,
Ivan
--
Ivan CALANDRA
Université de Bourgogne
UMR CNRS/uB 6282 Biogéosciences
6 Boulevard Gabriel
Hello,Thanks a lot for your help.
each index represents the different price band. I more prefer to use price band
info as 0-10 instead of 1...
I just can not find the way to do it.
Kind regards,
Tammy
Date: Fri, 25 Jan 2013 10:46:45 +0100
From: ivan.calan...@u-bourgogne.fr
To:
If names() is not what you need, then you have to explain your problem
better.
Ivan
--
Ivan CALANDRA
Université de Bourgogne
UMR CNRS/uB 6282 Biogéosciences
6 Boulevard Gabriel
21000 Dijon, FRANCE
+33(0)3.80.39.63.06
ivan.calan...@u-bourgogne.fr
http://biogeosciences.u-bourgogne.fr/calandra
Le
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of David Studer
Sent: Friday, January 25, 2013 9:28 AM
To: r-help@r-project.org
Subject: [R] Recoding variables (without recode() )
Hi everybody!
I have a rather simple
Hi
Attachment did not went through. Can you show us result of dput(head(data)) or
output from str(data)?
Anyway I wonder how time can became temperature. R is smart but I do not
believe that during import it somehow gets a local temperature at given time
and put it in your data.
Regards
Petr
Hello, Marco,
I am not quite sure if understand correctly what you want, but maybe
DF - data.frame( Artist, Begin, End, Istitution)
AtSameInst - outer( DF$Istitution, DF$Istitution, ==)
Simultaneously - with( DF, outer( Begin, End, =) |
outer( End, Begin, =))
Hi, I need help with two related issues:
1. I wish to drop repeating text BST from the below 'dates' string:
[1] 2005-04-01 BST 2005-04-04 BST 2005-04-05 BST 2005-04-06 BST
2005-04-07 BST 2005-04-08 BST 2005-04-11 BST 2005-04-12 BST
2005-04-13 BST 2005-04-14 BST
2. I then wish to add this
HI, All,
I have three dabases:
analysis_tool.accdb is linked into sellout.mdb and audit.accdb.
whenever I use this database, I need to firstly open analysis_tool, then
press External data-Linked Table Manager to link the other two databases.
Now I want to load the data from those database
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of kevj1980
Sent: Friday, January 25, 2013 11:22 AM
To: r-help@r-project.org
Subject: [R] Help with adding 'dates' string as rownames to matrix
Hi, I need help with two
On 25-01-2013, at 10:25, marcoguerzoni marco.guerz...@unito.it wrote:
dear all,
thank you for reading.
I have a dataset of artists and where and when they had an exhibition.
I'd like to create an affiliation network in the form of matrix, telling me
which aritist have been in the same
Thank you Petr!
--
View this message in context:
http://r.789695.n4.nabble.com/Help-with-adding-dates-string-as-rownames-to-matrix-tp4656611p4656617.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
Hello PIKAL Petr!
On Fri, 25 Jan 2013 10:09:54 + you wrote:
Hi
Attachment did not went through. Can you show us result of
dput(head(data)) or output from str(data)?
Anyway I wonder how time can became temperature. R is smart but I do
not believe that during import it somehow gets a
I still don't understand what you are looking for, but
https://gist.github.com/ is similar to pastebin, and it does have R
syntax highlighting.
Best,
Ista
On Thu, Jan 24, 2013 at 8:37 PM, C W tmrs...@gmail.com wrote:
I ran across this page for C, Java, etc. No R.
http://pastebin.com/
It
HI,
I have the list:
suu
[[1]]
NULL
[[2]]
NULL
[[3]]
item_id prod
1 2
[[4]]
item_id prod
1 2
2 4
how to delete all NULL elements from suu to get only
suu
[[3]]
item_id prod
1 2
[[4]]
item_id prod
1 2
2 4
??
Kind
On 25.01.2013 12:08, Berend Hasselman wrote:
On 25-01-2013, at 10:25, marcoguerzoni marco.guerz...@unito.it
wrote:
dear all,
thank you for reading.
I have a dataset of artists and where and when they had an
exhibition.
I'd like to create an affiliation network in the form of matrix,
Hello,
Try the following.
suu - list(NULL, NULL, 1:2, matrix(1:4, 2))
suu[!sapply(suu, is.null)]
Hope this helps,
Rui Barradas
Em 25-01-2013 12:31, Tammy Ma escreveu:
HI,
I have the list:
suu
[[1]]
NULL
[[2]]
NULL
[[3]]
item_id prod
1 2
[[4]]
item_id prod
1
Tammy Ma metal_licaling at live.com writes:
suu
[[1]]
NULL
[[2]]
NULL
[[3]]
item_id prod
1 2
[[4]]
item_id prod
1 2
2 4
how to delete all NULL elements from suu to get only
suu
[[3]]
item_id prod
1 2
[[4]]
item_id prod
1
Quite a long time ago, there was a thread about generalized eigenvalues,
which ended inconclusively.
http://tolstoy.newcastle.edu.au/R/help/05/06/6832.html
For students, a good proposal for the Google Summer of Code (gsoc-r)
would be a nice interface to things like the QZ algorithm and
The normalization is the same as is found when you have type=terms from a gam model:
each term is centered so that mean(predicted) = 0. For a simple linear term beta*age this
implies that the predicted value will be 0 at the mean of age, for a polynomial or spline
this does not translate to a
-Original Message-
I'd love to write a code that would allow me replace the example code:
fit1F - mle2(LL, fixed=list(xhalf=6))
with something like:
var-xhalf
val-6
fit1F - mle2(LL, fixed=list(var=val))
or
var-c(xhalf,=)
val-6
fit1F - mle2(LL, fixed=list(var,val))
On Jan 23, 2013, at 5:45 AM, Simonas Kecorius wrote:
I found a code:
y.ts - ts(data, frequency=12)
aggregate(y.ts, FUN=quantile, probs=0.10)
Seems it works fine even for a big data.frame.
Except for the fact that 'y.ts' is not a dataframe, so you are using a
function that has different
The image came through but no data. I'd suggest using ?dput to send the data.
John Kane
Kingston ON Canada
-Original Message-
From: janesh.devk...@gmail.com
Sent: Thu, 24 Jan 2013 11:46:53 -0600
To: r-help@r-project.org
Subject: [R] Insert segment only on particular facets in
What a shame..
Don't know the details about ts, but I tried the code with data.frame, then
checked the result with OpenOffice offered percentiles for the same data.
It was identical, so now I am a bit confused...
2013/1/25 David Winsemius dwinsem...@comcast.net
On Jan 23, 2013, at 5:45 AM,
Thank you, Terry.
So in the spline model, how to do the interpretation for HR? For linear
term, the HR can be interpreted as comparing a person with age 65, for
example, against mean age. But if there is no defined centering point in
spline, what's the compared value when we do the interpretation?
I am trying to use the cfa command in the lavaan package to run a CFA
however I am unsure over a couple of issues.
I have @25 dichotomous variables, 300 observations and an EFA on a
training dataset suggests a 3 factor model.
That is a lot of variables, and a rather small sample size (for
Dear R family,
I want to calculate the joint probability (distribution) of two random
continuous variables X and Y.
Could to please tell me how to do it?Thanks in advance..
elisa
[[alternative HTML version deleted]]
All,
I have some csv files I am trying to import. I am finding that quotes inside
strings are escaped in a way R doesn't expect for csv files. The problem only
seems to rear its ugly head when there are an uneven number of internal quotes.
I'll try to recreate the problem:
# set up a
Drat, I forgot to tell you what system I am on:
sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
LC_MONETARY=English_United States.1252 LC_NUMERIC=C
Hi,
To clarify further: these are results for degradation studies.
We search for degradations at 0 months, again at 3 months, again at 6 months,
...
Each analysis gives us a rrt, and a result.
To make final conclusions, we have to align the results manually (at least for
now).
rrt is
On Jan 25, 2013, at 10:42 AM, Tim Howard wrote:
All,
I have some csv files I am trying to import. I am finding that quotes inside
strings are escaped in a way R doesn't expect for csv files. The problem only
seems to rear its ugly head when there are an uneven number of internal
Great point, your fix (quote=) works for the example I gave. Unfortunately,
these text strings have commas in them as well(!). Throw a few commas in any
of the text strings and it breaks again. Sorry about not including those in
the example.
So, I need to incorporate commas *and* quotes
Undoubtedly this question has been asked before, I just can't seem to find
the combination of search terms to produce it. I'm trying to resize a
dataset that is pulled into R using read.table. However, I think the same
problem can be produced using matrix:
x-matrix(1:64,8)
x
# [,1] [,2]
Hello,
You need to be much more specific. What do you know about the
distributions of X and Y? And about their joint distribution?
If you suspect the joint distribution to be a bivariate normal try
package mvtnorm with
mu - c(mean(x), mean(y))
sigma - cov(cbind(x, y))
You can also try
On Jan 25, 2013, at 11:35 AM, Tim Howard wrote:
Great point, your fix (quote=) works for the example I gave. Unfortunately,
these text strings have commas in them as well(!). Throw a few commas in any
of the text strings and it breaks again. Sorry about not including those in
the
Not sure what is your exact requirement but you can compute marginals
and conditional probabilities using 'prob' package of Prof. Kerns.
On 25 January 2013 22:15, Rui Barradas ruipbarra...@sapo.pt wrote:
Hello,
You need to be much more specific. What do you know about the distributions
of X
David,
Thank you again for the reply. I'll try to make readLines() and strplit() work.
What bugs me is that I think it would import fine if the folks who created the
csv had used double quotes rather than an escaped quote \ for those pesky
internal quotes. Since that's the case, I'd think
On Jan 25, 2013, at 1:37 PM, Tim Howard wrote:
David,
Thank you again for the reply. I'll try to make readLines() and strplit()
work. What bugs me is that I think it would import fine if the folks who
created the csv had used double quotes rather than an escaped quote \ for
those pesky
On Jan 25, 2013, at 1:12 PM, emorway wrote:
Undoubtedly this question has been asked before, I just can't seem to find
the combination of search terms to produce it. I'm trying to resize a
dataset that is pulled into R using read.table. However, I think the same
problem can be produced
Thanks for taking to time to help me out with this, I really appreciate it!
Quoting S Ellison-2 [via R] ml-node+s789695n465663...@n4.nabble.com:
-Original Message-
I'd love to write a code that would allow me replace the example code:
fit1F - mle2(LL, fixed=list(xhalf=6))
with
Dear All
I have the following data (somewhat simplyfied):
TINF -1
a -c(500,750,1000,1250,1500,1750,2000)
b -c(8,12,18,24,36,48,60,72,96)
following function:
infcprodessa -function (D, tin, tau, ts)
(D * (1 - exp(-0.048 * tin))/(tin * (0.048*79) * (1 - exp(-0.048 * tau *
exp(-0.048
I played around with your example on the smaller dataset, and it seemed like
it was doing what I wanted. However, applying it to the larger problem, I
didn't get a resized 2D dataset that preserved the order I was hoping for.
Hopefully the following illustrates the larger problem:
Hello,
I'm searching for a test that applies to a dataset (N=36) with a continuous
zero-inflated dependent variable and only one nominal grouping variable
with 2 levels (balanced).
In fact there are 4 response variables of this kind which I plan to test
seperately - the amount of zeroes ranges
On 1/25/2013 2:29 PM, emorway wrote:
I played around with your example on the smaller dataset, and it seemed like
it was doing what I wanted. However, applying it to the larger problem, I
didn't get a resized 2D dataset that preserved the order I was hoping for.
Hopefully the following
On Jan 25, 2013, at 2:29 PM, emorway wrote:
I played around with your example on the smaller dataset, and it seemed like
it was doing what I wanted. However, applying it to the larger problem, I
didn't get a resized 2D dataset that preserved the order I was hoping for.
Hopefully the
On Fri, 25 Jan 2013, Kay Cichini wrote:
Hello,
I'm searching for a test that applies to a dataset (N=36) with a
continuous zero-inflated dependent variable
In a regression setup, one can use a regression model with a response
censored at zero. survreg() in survival fits such models,
On 13-01-25 4:37 PM, Tim Howard wrote:
David,
Thank you again for the reply. I'll try to make readLines() and strplit() work. What bugs me
is that I think it would import fine if the folks who created the csv had used double quotes
rather than an escaped quote \ for those pesky internal
Hi,
I want to know if it's possible to pass a vector v=c(x,y,...) to a
function f(x,y,...) so that each vector element corresponds to a
formal argument of the function. For python programmers: f(*v).
Specifically, what I'm trying to achieve is: given a list of
coordinates l=list(c(x1,y1,z1),
Well, of course the answer is yes (it always is!). I'm just not sure
what the question is.
However, I believe you want something like
do.call(the_function, parameter_list).
?do.call ## for details.
Note that if v is really a (named) vector, it can be converted to a
list via as.list().
Your whole premise that the arguments of a function should be mappable to
elements of a vector seems contrary to good R programming practice. Consider
changing the called function's handling of arguments instead to accept the
vector of data directly if a vector makes sense, or to a list if the
Thanks Bert, do.call is exactly what I was looking for. What in lisp
is apply and in python f(*v).
Your whole premise that the arguments of a function should be mappable to
elements of a vector seems contrary to good R programming practice.
Jeff I didn't pretend to imply that the mapping
Jeff I didn't pretend to imply that the mapping should by always
s/by always/always be/
Sorry.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
On OS X 10.8.2, after I installed ggplot2, and picked mirror of Singapore. it
could not find qplot function.
Could anyone pls help me ? Thank you.
Pls see:
install.packages(ggplot2)--- Please select a CRAN mirror for use in this
session ---also installing the dependencies ¡®colorspace¡¯,
Or,
suu[unlist(lapply(suu,length)!=0)]
#[[1]]
#[1] 1 2
#[[2]]
# [,1] [,2]
#[1,] 1 3
#[2,] 2 4
A.K.
- Original Message -
From: Rui Barradas ruipbarra...@sapo.pt
To: Tammy Ma metal_lical...@live.com
Cc: r-help@r-project.org r-help@r-project.org
Sent: Friday, January 25,
This idea is very simple and helpful. But one has to start with 0.05.
Thanks.
test.df$n- seq(0.05,1, by=0.05)
2013/1/24 Rui Barradas ruipbarra...@sapo.pt
Hello,
try the following.
test.df$Var1 - seq(0,1, by=0.05)[-1]
test.df
Hope this helps,
Rui Barradas
Em 24-01-2013 17:39, Wim
Dear All,
During the last few days I've been trying to get ggplot2 installed in my Mac
but when installing dependencies I cannot access dichromat.
Error in download.file(url, destfile, method, mode = wb, ...) :
cannot open URL
Dear Herry,
I would like to know if you found an answer elsewhere to your question.
I'm trying to get information around the nodes of a CA (daisy() followed
by agnes()) made on plant trait using the gower metric for taxonomic
purpuse. I'm not an expert in statistic but I understood that your way
Hi,
Try this:
Dates1-c(2005-04-01 BST,2005-04-04 BST,2005-04-05 BST)
Dates2-as.Date(gsub(\\s+\\w+$,,Dates1))
mat1-matrix(1:9,nrow=3)
library(zoo)
z1-zoo(mat1,Dates2)
z1
#
#2005-04-01 1 4 7
#2005-04-04 2 5 8
#2005-04-05 3 6 9
#if you use:
mat2-matrix(1:9,nrow=3)
which(x==1,arr.ind=TRUE)
row col
#[1,] 1 7
y-t(matrix(x,nrow=546))
which(y==1,arr.ind=TRUE)
# row col
#[1,] 341 328
A.K.
- Original Message -
From: emorway emor...@usgs.gov
To: r-help@r-project.org
Cc:
Sent: Friday, January 25, 2013 5:29 PM
Subject: Re: [R] resizing
Hi,
Your question is bit confusing to me.
When you say that which rrts are the same, and which are the new ones, to
me it looks like 0.35, 0.36 are new addition to Mnd at time points 6 and 9.
Extending Dennis' solution:
Just for understanding the problem:
On Jan 25, 2013, at 5:55 AM, Yongjie ZHANG wrote:
On OS X 10.8.2, after I installed ggplot2, and picked mirror of Singapore. it
could not find qplot function.
Could anyone pls help me ? Thank you.
Pls see:
install.packages(ggplot2)--- Please select a CRAN mirror for use in this
session
HI,
It's not clear why you wanted to take the transpose and resize it afterwards.
It could be done in one step as David suggested.
Suppose, you wanted to get the result after you transposed the matrix:
x-matrix(1:64,8)
x1-t(x)
matrix(unlist(split(x1,row(x1))),ncol=4,byrow=T)
# [,1] [,2]
Hi all,
I'd like to write a piece of code which will remove columns from a matrix, if
the column contains only one value, say every value in the column is a 3:
Matrix - matrix(NA, nrow=5, ncol=4)
Matrix[,1] - c(1,2,3,4,5)
Matrix[,2] - c(3,3,3,3,3)
Matrix[,3] - c(5,4,3,2,1)
Matrix[,4] -
Hi,
Inline:
- Original Message -
From: emorway emor...@usgs.gov
To: r-help@r-project.org
Cc:
Sent: Friday, January 25, 2013 5:29 PM
Subject: Re: [R] resizing data
I played around with your example on the smaller dataset, and it seemed like
it was doing what I wanted. However,
On Jan 25, 2013, at 7:00 AM, Andres, Jose wrote:
Dear All,
During the last few days I've been trying to get ggplot2 installed in my Mac
but when installing dependencies I cannot access dichromat.
Error in download.file(url, destfile, method, mode = wb, ...) :
cannot open URL
Benjamin Ward (ENV B.Ward at uea.ac.uk writes:
I'd like to write a piece of code which will remove columns from a matrix, if
the column contains only one
value, say every value in the column is a 3:
Matrix - matrix(NA, nrow=5, ncol=4)
Matrix[,1] - c(1,2,3,4,5)
Matrix[,2] - c(3,3,3,3,3)
In view of our private communication on this matter (to the effect that
you had not been able to elicit a response from Vito Muggeo) I did a
little delving into the code of segmented.lm(). I ***think*** I have found
the problem. On line 243 (of the code as seen from loading the package)
the
Hi,
May be this helps:
Matrix[,colSums(diff(Matrix))!=0]
# [,1] [,2] [,3]
#[1,] 1 5 5
#[2,] 2 4 1
#[3,] 3 3 4
#[4,] 4 2 3
#[5,] 5 1 2
A.K.
- Original Message -
From: Benjamin Ward (ENV) b.w...@uea.ac.uk
To: r-help@r-project.org
HI,
You could use ?Reduce() also in the second case:
lapply(vs,function(v){Reduce(f,as.list(v))})
#[[1]]
#[1] 10
#[[2]]
#[1] 6
#[[3]]
#[1] 1
A.K.
- Original Message -
From: Carlos Pita carlosjosep...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Friday, January 25, 2013 7:46 PM
Hi,
I guess this should also work:
Matrix[,apply(Matrix,2,function(x) all(c(TRUE,x[-length(x)]!=x[-1])))]
# [,1] [,2] [,3]
#[1,] 1 5 5
#[2,] 2 4 1
#[3,] 3 3 4
#[4,] 4 2 3
#[5,] 5 1 2
A.K.
- Original Message -
From: Benjamin Ward (ENV)
How about (assuming the variables you defined):
ms - matrix(unlist(vs), ncol=2,byrow=TRUE)
m[ms]
---
Jeff NewmillerThe . . Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics:
Please read the Posting Guide
no html email
reproducible example please
In general, you can use expand.grid to generate all combinations of inputs,
compute results as a vector just as long as the expand.grid data frame has
rows, and identify which results meet your criteria by a logical test,
80 matches
Mail list logo