raje...@cse.iitm.ac.in wrote:
Is it possible to uncompress gzipped data coming over a socket?
As far I remember a message by Brian Ripley (I could not find it, though),
it's not possible directly. You have to save as a file and read from disk;
see docs on connection.
Dieter
--
View
Hi,
I fail to find choose.dir() in my current R install (see below)? Didn't
that exist at some point? How to achieve file.choose() equivalent
functionality for directories?
Thanks for any hints, Joh
sessionInfo()
R version 2.11.1 (2010-05-31)
x86_64-pc-linux-gnu
locale:
[1]
OK. Just checked and choose.file/choose.dir exists in the windows
version - apparently not in the linux one ... does anybody have a nice
platform-agnostic solution for this?
Thanks, Joh
Johannes Graumann wrote:
Hi,
I fail to find choose.dir() in my current R install (see below)? Didn't
Thank you so much for your answer, it has been really useful. I have already
included the interactions in the models and I have obtained better results.
Best regards,
Lucía Cañás
Lucía Cañás Ferreiro
Instituto Español de Oceanografía
Centro Oceanográfico de A Coruña
Paseo Marítimo Alcalde
Hi.
Im writing a small test program just to see how passing arguments work with
R.
From the command line everything works as expected but from inside R using
source(test.R) i dont know where and how to send in the arguments did try
source(test.R --test) but it just says that it cant find or open
On Wed, Sep 8, 2010 at 10:11 AM, Joel joda2...@student.uu.se wrote:
Hi.
Im writing a small test program just to see how passing arguments work with
R.
From the command line everything works as expected but from inside R using
source(test.R) i dont know where and how to send in the arguments
Dear Joh,
On Wed, Sep 8, 2010 at 3:18 AM, Johannes Graumann
johannes_graum...@web.de wrote:
OK. Just checked and choose.file/choose.dir exists in the windows
version - apparently not in the linux one ... does anybody have a nice
platform-agnostic solution for this?
Thanks, Joh
[snip]
Have
That is true but then I (or anyone else using the script) most know exactly
what the name in the script is to be able to set it correctly and so on.
Therefor it would be much better to be able to just send in the value and
let the script handle the variable setting.
But thx for the answer
Have a look at gzcon, for decompressing data as they arrive. From the
help file:
‘gzcon’ provides a modified connection that wraps an existing
connection, and decompresses reads or compresses writes through
that connection. Standard ‘gzip’ headers are assumed.
There is no
On Wed, Sep 8, 2010 at 11:29 AM, Joel joda2...@student.uu.se wrote:
That is true but then I (or anyone else using the script) most know exactly
what the name in the script is to be able to set it correctly and so on.
Therefor it would be much better to be able to just send in the value and
Ok, thanks a lot ! I tried to compute the inverse of the variance covariance
matrix of the estimators with vcov, which gave me this error :
require(MASS)
data(iris)
model=polr(Species~Sepal.Length+Sepal.Width+Petal.Length+Petal.Width,iris,start
= rep(1, 6),method= logistic)
require(stats)
Hi,
How does R automatically load functions so that they are available from the
workspace? Is it anything like Matlab - you just specify a directory path
and it finds it?
The reason I ask is because I found a really nice script that I would like
to use on a regular basis, and it would be nice
Hi R experts,
I have set of data consists of 50 data. some of them are missing. I would
need a function in R that can estimate missing data using interpolation
methods.
If you know this kind of function, write me the name of the function and its
library.
Thanks very much in advance!
abotaha
Hi,
I have a preallocated dataframe to which I have to add a list whose vectors
will become rows in the dataframe. This is done iteratively. How can I do this?
I'm dealing with very large numbers...list of 1000 vectors to a dataframe of
20 iteratively
for e.g.
my list is as follows
Hi experts,
I have a subspace represented as matrix of basic vectors and I want to
project a vector on that subspace. Does R have any function that help me to
do so?
Thanks,
James.
--
View this message in context:
Dear colleagues!
Is it possible to make predictions in R?
there is an exponential relationship detween y and x
x-c(0.001,0.003,0.01,0.16,0.3,0.7,0.9)
y-c(38.8,41.5,44.2,27,26.9,6.9,3)
f-function(x,a,b){a*exp(b*x)}
fm-nls(y~f(x,a,b), start=c(a=1,b=1))
How one can predict x when y=10 and is it
Dear colleagues!
Is it possible to make predictions in R?
there is an exponential relationship detween y and x
x-c(0.001,0.003,0.01,0.16,0.3,0.7,0.9)
y-c(38.8,41.5,44.2,27,26.9,6.9,3)
f-function(x,a,b){a*exp(b*x)}
fm-nls(y~f(x,a,b), start=c(a=1,b=1))
How one can predict x when y=10 and is it
Dear All,
Could someone please advice me the way to change the size of the title and x
and
y-label in plot() function. I've tried to use 'font' and 'font.main' call in
plot() function, but it didn't make any changes in terms of the size.
Thanks
Fir
Mnay thanks fr suggestions. I am afraid this is one tough daatframe...
t = sqldf(select h, count(*) from x group by h)
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: no such table: x)
In addition: Warning message:
In value[[3L]](cond) : RAW()
Maybe 'tk_choose.dir' in the tcltk package will do what you want.
--- On Wed, 9/8/10, Johannes Graumann johannes_graum...@web.de wrote:
From: Johannes Graumann johannes_graum...@web.de
Subject: Re: [R] choose.dir() gone?
To: r-h...@stat.math.ethz.ch
Date: Wednesday, September 8, 2010, 3:18
Dear all,
I need to estimate intensity and probability matrices by the continuous-time
markov model... in a first time I used msm and it works perfectly.
Nevertheless, I have to do other estimations that need programming the
likelihood. Is it possible to see somewhere the likelihood used in
I was able to aggregate (with sqldf, at least), after saving and re-loading
the dataframe. My first guess was that h (and/or price?) now being a factor
- stringsAsFactors = T by default - made the difference, and I tried to
convert x$h to factor, but received an error.
--
View this message in
Hello,
I searched the internet but i didn't find the answer for the next problem:
I want to do a glm on a csv file consisting of 25 columns and 4 mln rows.
Not all the columns are relevant. My problem is to read the data into R.
Manipulate the data and then do a glm.
I've tried with:
You can create a .First function in your .Rprofile file (which will
be in ~/.Rprofile). For example
.First - function(){
source(Friedman-Test-with-Post-Hoc.r.txt)
}
You can also create your own package (mylibrary) down the line (see
the R manual for creating extensions at
Dear all,
I need to estimate intensity and probability matrices by the continuous-time
markov model... in a first time I used msm and it works perfectly.
Nevertheless, I have to do other estimations that need programming the
likelihood. Is it possible to see somewhere the likelihood used in
Thats an idea will try it out and see how it works
Thanks a lot for your help.
Joel
--
View this message in context:
http://r.789695.n4.nabble.com/Passing-aruments-with-source-tp2531012p2531138.html
Sent from the R help mailing list archive at Nabble.com.
Hi,
I have huge matrices in which the response variable is in the first
column and the regressors are in the other columns. What I wanted to do
now is something like this:
#this is just to get an example-matrix
DataMatrix - rep(1,1000);
Disturbance - rnorm(900);
DataMatrix[101:1000] -
try:
?title
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-change-font-size-in-plot-function-tp2531127p2531161.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
By far the easiest way to achieve this would be to use the bigmemory
C++ structures in your program itself. However, if you do something
on your own (but fundamentally have a column-major matrix in shared
memory), it should be possible to play around with the pointer with
R/bigmemory to
predict x for a given y(response)? If this is the case, you will have
multiple x for a single y for this exponential model. In terms of logistic
regression, If y =1, logit([P(Y=1)] = a + b*bx has infinite many x. The
question seems not quite clear to me.
--
View this message in context:
Dear all,
I'm working with two data frames.
The first frame (agg_data) consists of two columns. agg_data[,1] is a unique
ID for each row and agg_data[,2] contains a continuous variable.
The second data frame (geo_data) consists of several columns. One of these
columns (geo_data$ZCTA)
Have a look at match and merge.
Hadley
On Wednesday, September 8, 2010, Michael Haenlein
haenl...@escpeurope.eu wrote:
Dear all,
I'm working with two data frames.
The first frame (agg_data) consists of two columns. agg_data[,1] is a unique
ID for each row and agg_data[,2] contains a
On 8 September 2010 at 13:26, André de Boer wrote:
| I searched the internet but i didn't find the answer for the next problem:
| I want to do a glm on a csv file consisting of 25 columns and 4 mln rows.
| Not all the columns are relevant. My problem is to read the data into R.
| Manipulate the
Dear list
It seems to me that extracting elements from a list using '[[' is somewhat
faster than using '$'. For example:
x- as.list(1:25)
names(x) - letters[1:length(x)]
dput(x)
structure(list(a = 1L, b = 2L, c = 3L, d = 4L, e = 5L, f = 6L,
g = 7L, h = 8L, i = 9L, j = 10L, k =
For Python, check out the project orange:
http://www.ailab.si/orange/doc/catalog/Classify/ClassificationTree.htm
Not sure about C++, but OpenDT is in C:
http://opendt.sourceforge.net/
Looks like OpenCV has both Python and C++ interface (didn't see Python interace
to decision tree, though):
Dear expeRts,
?xyplot says: In general, giving a high value of ‘layout[3]’ is not
wasteful because blank pages are never created.
But the following example does generate blank pages - well except for
the ylab:
data(barley)
require(lattice)
stripplot(yield~year|site, barley,
Can you be a little bit more specific? For example, the base vectors of the
subspace and the vector you want to project. Specific artificial
vectors/matrices are helpful.
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-project-a-vector-on-a-subspace-tp2530886p2531245.html
On Wed, Sep 8, 2010 at 2:52 AM, James vuda...@gmail.com wrote:
Hi experts,
I have a subspace represented as matrix of basic vectors and I want to
project a vector on that subspace. Does R have any function that help me to
do so?
The projection of vector y onto the space spanned by the
Hi Peng,
Thanks for your reply. I have tried it and it does work fine
apart from one problem. Even though the second data set
has same length as the first one, the point function seems
to shit all the points towards left side. So the points are not
in concordat co-ordinates as the bars. Any
Hi,
is there a shared memory implementation for R windows, preferably something
that resembles the boost c++ libraries
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
Dear all,
I'm optimizing a relatively simple function. Using optimize the optimized
parameter value is worse than the starting.
why?
f-function(delta,P,U){
minimiz-P+delta*U
x-minimiz[1]
y-minimiz[2]
z-100*(y-x^2)^2+(1-x)^2
return(z)
}
result-optimize(f, interval=c(-10,
Hello,
I would like to uniformly distribute values from 0 to 200. Can someone help me
find the appropriate uniform distribution generator?
I would like to thank you in advance for your help.
Best Regards
Alex
[[alternative HTML version deleted]]
Hi Alex,
help.search(uniform)
HTH,
Stephan
Am 08.09.2010 15:36, schrieb Alaios:
Hello,
I would like to uniformly distribute values from 0 to 200. Can someone help me
find the appropriate uniform distribution generator?
I would like to thank you in advance for your help.
Best Regards
Alex
try packages:
{yaImpute}, {impute}, etc.
--
View this message in context:
http://r.789695.n4.nabble.com/Interpolation-missing-data-tp2530871p2531288.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
?runif
--
View this message in context:
http://r.789695.n4.nabble.com/Uniform-Distribution-tp2531282p2531292.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
On Wed, 2010-09-08 at 06:36 -0700, Alaios wrote:
Hello,
I would like to uniformly distribute values from 0 to 200. Can someone help
me
find the appropriate uniform distribution generator?
I would like to thank you in advance for your help.
Best Regards
Alex
?runif
runif(10, min =
Thanks a lot. Tired the help.search(uniform) one other member of the list
told
me but the computer 10 minutes now it is scanning to infinity :)
From: Gavin Simpson gavin.simp...@ucl.ac.uk
Cc: r-help@r-project.org
Sent: Wed, September 8, 2010 3:45:12 PM
Is there any package for clustering of circular data?
karsar
__
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,
Hi Nan,
You can take a look at the optimx package on CRAN. John Nash and I wrote
this package to help lay and sophisticated users alike. This package
unifies various optimization algorithms in R for smooth, box-constrained
optimization. It has features for checking objective function, gradient
Dieter Menne had already told you what the problem is. You have 2 local
minima. One is a global minimum. Depending on your starting interval, the
optimizer can converge to one of the two local minima. If you want to be
reasonably sure that you always find the global minimum, you either have to
On Sep 8, 2010, at 15:22 , Gabor Grothendieck wrote:
On Wed, Sep 8, 2010 at 2:52 AM, James vuda...@gmail.com wrote:
Hi experts,
I have a subspace represented as matrix of basic vectors and I want to
project a vector on that subspace. Does R have any function that help me to
do so?
On Sep 8, 2010, at 7:34 AM, Philipp Kunze wrote:
Hi,
I have huge matrices in which the response variable is in the first
column and the regressors are in the other columns. What I wanted to
do
now is something like this:
#this is just to get an example-matrix
DataMatrix - rep(1,1000);
That is one method, but he should also review:
?par
where he will discover that cex.main is a parameter that could be used
from within the plot function.
FMH had written, by Peng, C had failed to include context:
Could someone please advice me the way to change the size of the
title
On Wed, Sep 8, 2010 at 1:35 PM, Michael Bernsteiner
dethl...@hotmail.com wrote:
Dear all,
I'm optimizing a relatively simple function. Using optimize the optimized
parameter value is worse than the starting.
why?
f-function(delta,P,U){
minimiz-P+delta*U
x-minimiz[1]
Hi,
I have modified the USJudgeRatings data (available in R) to
illustrate my question.
# Use the first 4 variables of USJudgeRatings and add a group variable
with two levels
USJudgeRatings - USJudgeRatings[,1:4]
USJudgeRatings$group - factor(c(rep(1, 22), rep(0, 21)))
# I can draw a pairs
Hi Mamum,
The co-ordinates appear shifted because the bars are not centered at
1, 2, 3, etc. To give an example:
# Create a barplot
# of the numbers 1 through 10
barplot(1:10)
# Now look at the x axis coordinates of these actual bars
barplot(1:10, plot = FALSE)
# One way to get these
Dear all.
I'm using igraph package, and do a research about network analysis.
With power.law.fit from igraph package, it seems that we can fit a power law
distribution to some data.
But, I want to know how to judge whether the network distribution follows a
power law or not.
Does anyone
Hello everyone,
Could you please help me find out if R supports matrixes inside matrixes?
This is what I would like to do
I have an area map of humidity per km. I would like at every cell to keep also
information about the height of this area, the current temperature etc.
Is something like
Hello,
from ?array
An array in R can have one, two or more dimensions. It is simply
a vector which is stored with additional attributes giving the
dimensions (attribute ‘dim’) and optionally names for those
dimensions (attribute ‘dimnames’).
A two-dimensional array is
Hi,
Just create a file called .Rprofile that is located in your working
directory (this means you could actually have different ones in each
working directory). In that file, you can put in code just like any
other code that would be source()d in. For instance, all my .Rprofile
files start
I generated a heatmap in R using the following commands:
mydata - read.csv(file=Data.csv, header=TRUE, sep=,)
mydata - mydata[rowSums(mydata[,-1]^2) 0, ]
rownames(mydata)=mydata$Name
mydata - mydata[,2:253]
mydatamatrix - data.matrix(mydata)
mydatascale - t(scale(t(mydatamatrix)))
hr -
I generated a heatmap in R using the following commands:
mydata - read.csv(file=Data.csv, header=TRUE, sep=,)
mydata - mydata[rowSums(mydata[,-1]^2) 0, ]
rownames(mydata)=mydata$Name
mydata - mydata[,2:253]
mydatamatrix - data.matrix(mydata)
mydatascale - t(scale(t(mydatamatrix)))
hr -
Hi,
Without your data, we cannot actually reproduce your plot; however, if
you cannot read labels, there are generally three options.
1) Make the labels smaller (I have not used the function you used, so
I'm not sure exactly how one would)
2) Use fewer labels (if you need them all, this is a
Hi,
I am fitting a GEE model using gee R package, but I am not sure how to get
OR and its CI?
Could anyone give me some hints?
Here are some output:
gee.obj - gee(Affection~Sibsex+Probandsex,id = FAMID,family =
binomial,corstr = independence,data =seldata)
Beginning Cgee
Hi,
You can have each cell of a matrix contain a matrix, but for a reason
that is just not clear to me the matrices are wrapped in a list,
m = matrix(replicate(4,matrix(1:9,3,3),simplify=FALSE), 2,2)
m[1,2][[1]]
str(m)
and even more surprising to me, m itself has become a list for some
Side note, since Nabble posts to R-help also, you only need to use
Nabble or email, not both.
__
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
Greetings,
I am writing with a question regarding plotting using the xyplot command in
lattice. I currently have the commands shown below, but I need to produce a
plot that orders the Month variable differently. I was told to use the
lattice.options command (shown below) to change the plot
.. Not quite.
?Startup
provides details, but note the comment about only the base package
being loaded and the need to use somepackage::somefunction() or to
explicitly first load a package whose functions are used in .Profile.
Note also that .First could also be used instead of putting the code
On Wed, Sep 8, 2010 at 4:32 PM, BD bhakti.dwiv...@gmail.com wrote:
I generated a heatmap in R using the following commands:
mydata - read.csv(file=Data.csv, header=TRUE, sep=,)
mydata - mydata[rowSums(mydata[,-1]^2) 0, ]
rownames(mydata)=mydata$Name
mydata - mydata[,2:253]
mydatamatrix -
Thanks! I will try it now. I am using linux too!
Bhakti
On Wed, Sep 8, 2010 at 11:54 AM, Barry Rowlingson [via R]
ml-node+2531559-939380251-160...@n4.nabble.comml-node%2b2531559-939380251-160...@n4.nabble.com
wrote:
On Wed, Sep 8, 2010 at 4:32 PM, BD [hidden
Numerical optimisations are best done using as many methods as possible
See the optimx package:
http://cran.r-project.org/web/packages/optimx/index.html
Ravi.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Barry Rowlingson
Sent:
I am looking for the syntax to capture XML tags marked with
/DescriptorName MajorTopicYN=Y/ , but the combination of the internal
space (between Name and Major and the embedded quote marks are
defeating me. I can get all the DescriptorName tags, but these include
both MajroTopicYN = Y and
On Sep 8, 2010, at 10:34 AM, NatsumiYotsumoto wrote:
Dear all.
I'm using igraph package, and do a research about network analysis.
With power.law.fit from igraph package, it seems that we can fit a
power law
distribution to some data.
But, I want to know how to judge whether the
Hello!
I would like to ask if R can solve the following problem.
I need to produce two 3d plots on a single page, that is
to arrange them one above the other. Also, I need to
visualize points by means of spheres, pyramids and cubes
in the 3d space. Also, I would like to fill these symbols
with
Have you considered doing a permutation test on the interaction?
Here is an article that gives the general procedure for a couple of algorithms
and a comparison of how well they do:
Anderson, Marti J and Legendre, Pierre; An Empirical Comparison of Permutation
Methods for Tests of Partial
Prior to creating a plot I usually just order the factor levels to the order
I want them in. So for your example I would do:
#Create some data
library(lattice)
x - runif(100, 0, 20)
df - data.frame(x)
df$y - (1:10)
df$Month - c(October, September, August, July,June)
#Plot the figure
plt
Hi:
You're fitting y as a function of x; as in any regression model, the x's are
assumed to be conditionally fixed. If you want to model x as a function of
y, that's a calibration problem.
There are several issues at play:
1. In the model, you have assumed x is fixed, but afterward, you want to
Ben and Ravi have already pointed out that you have a problem with a
non-computable (e.g., divide by zero or similar) objective function. This
is common.
optim() has mostly unconstrained optimizers. L-BFGS-B does handle box or
bounds constraints. There is also Rvmmin, which is supposedly the same
If you have Excel running with the sheet that you want to use open, then in R
you can just do:
write.table( 1:10, 'clipboard', sep='\t', row.names=FALSE, col.names=FALSE )
(replace 1:10 with your vector)
Then go to excel, right click on the cell where you want the first number to
be, and
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Sam Albers
Sent: Wednesday, September 08, 2010 9:42 AM
To: r-help@r-project.org
Subject: Re: [R] Change plot order in lattice xyplot
Prior to creating a plot I usually just
To add to Erik's answer:
You can use a three dimensional array
if all of your data for one cell is the
same type -- numeric presumably.
If the data were different types (numeric
and character, say), you could have a
matrix of mode list to do that. However,
that's unlikely to be worth the
In addition to Dirks advice about the biglm package, you may also want to look
at the RSQLite and SQLiteDF packages which may make dealing with the large
dataset faster and easier, especially for passing the chunks to bigglm.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Hi Rob
doc = xmlParse(url for document)
dn = getNodeSet(doc, //descriptorna...@majortopic = 'Y'])
will do what you want, I believe.
XPath - a language for expressing such queries - is quite
simple and based on a few simple primitive concepts from which
one can create complex compound
Hi,
I am having some strange problem with detecting try-error. From what I
have read so far the following statement:
try( log(a) ) == try-error
should yield TRUE, however, it yields FALSE. I can not figure out why. Can
someone help?
Many thanks
--
View this message in context:
On Sep 8, 2010, at 1:18 PM, telm8 wrote:
Hi,
I am having some strange problem with detecting try-error. From
what I
have read so far the following statement:
try( log(a) ) == try-error
should yield TRUE, however, it yields FALSE. I can not figure out
why. Can
someone help?
This is fairly simple using lattice graphics:
USJudgeRatings - USJudgeRatings[,1:4]
USJudgeRatings$group - factor(c(rep(1, 22), rep(0, 21)))
library(lattice)
splom( ~USJudgeRatings[,1:4], groups=group, data=USJudgeRatings,
type=c('p','smooth'))
The ggplot2 package probably makes this
Hi list,
I wonder if anyone has thoughts on making image plots in R [using image() or
image.plot(), or filled.contour()]- I've made quite a bit now, but they seem
quite large in size when exported to pdf file format (even after compressing
with pdftk or ghostscript, which I regularly do). I
Hi,
Have you tried the recent rasterImage() function?
HTH,
baptiste
On Sep 8, 2010, at 7:30 PM, Stephen T. wrote:
Hi list,
I wonder if anyone has thoughts on making image plots in R [using image() or
image.plot(), or filled.contour()]- I've made quite a bit now, but they seem
Thank worked! Thank you so much!!!
--
View this message in context:
http://r.789695.n4.nabble.com/try-error-can-not-be-test-Why-tp2531675p2531726.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
@Barry: Yes it is the Rosenbrock Function. I'm trying out some thing I found
here: http://math.fullerton.edu/mathews/n2003/PowellMethodMod.html
@Ravi: Thanks for your help. I will have a closer look at the BB package. Am I
right, that the optimx package is ofline atm? (Windows)
Michael
Problem solved..
My bad. No prb with cdplot or graphics-part. The problem was the a-list..
command which resulted in all three levels of bar$h.r in a[[1]]. Skipping the
list function sorted it out.
par(mfrow=c(2,2))
a-levels(bar$h.r)[c(1,3,6)]
print(a)
lapply(a,function(x){
telm8 chienlinterry.huang at postgrad.manchester.ac.uk writes:
Thank worked! Thank you so much!!!
in general it is safer (I think) to test
inherits(try(log(a)),try-error)
which takes care of the case when class(try(log(a))) has
length 1
Hi list,
I have a data frame (m) with 169221 rows and 10 columns and would like to make
a new column containing the content of column 3 but replace the NAs in column 3
with the data in column 1 (from the same row as the NA in column 3). Column 1
has data in all rows.
My first attempt was:
one way is the following:
m - data.frame(x = rnorm(100), y = rnorm(100), z = rnorm(100))
m$z[sample(100, 20)] - NA
m$z.new - ifelse(is.na(m$z), m$x, m$z)
I hope it helps.
Best,
Dimitris
On 9/8/2010 8:17 PM, Jakob Hedegaard wrote:
Hi list,
I have a data frame (m) with 169221 rows and 10
?ifelse
df$newCol - ifelse(is.na(df$col3), df$col1, df$col3)
On Wed, Sep 8, 2010 at 2:17 PM, Jakob Hedegaard
jakob.hedega...@agrsci.dk wrote:
Hi list,
I have a data frame (m) with 169221 rows and 10 columns and would like to
make a new column containing the content of column 3 but replace
Hi Jakob,
You can use is.na() to create an index of which rows in column 3 are
missing data, and then select these from column 1. Here is a simple
example:
dat - data.frame(V1 = 1:5, V3 = c(1, NA, 3, 4, NA))
dat$new - dat$V3
my.na - is.na(dat$V3)
dat$new[my.na] - dat$V1[my.na]
dat
This
Karen Sargsyan karsar at ibms.sinica.edu.tw writes:
Is there any package for clustering of circular data?
install.packages(sos)
library(sos)
findFn(circular clustering)
See first row ...
cheers
Ben Bolker
__
R-help@r-project.org mailing
One comment on the function: I see that it uses T/F instead of
TRUE/FALSE in a number of places. You'll save yourself some
headaches if you replace those 'T/F's.
-Peter Ehlers
On 2010-09-08 1:25, DrCJones wrote:
Hi,
How does R automatically load functions so that they are available from the
Greetings, Folks.
I'd appreciate being shown the way out of this one!
I've been round the documentation in ever-drecreasing
circles, and along other paths, without stumbling on
the answer.
The background to the question can be exemplified by
the example (no graphics window open to start with):
On Sep 8, 2010, at 2:24 PM, Joshua Wiley wrote:
Hi Jakob,
You can use is.na() to create an index of which rows in column 3 are
missing data, and then select these from column 1. Here is a simple
example:
dat - data.frame(V1 = 1:5, V3 = c(1, NA, 3, 4, NA))
dat$new - dat$V3
my.na -
1 - 100 of 159 matches
Mail list logo