Displaying 20 results from an estimated 20000 matches similar to: "Addressing Columns in a Data Frame"
2010 Oct 04
2
Reading Strings in R
Dear All,
I know this must be a one-liner, but I am experiencing problems.
I need to read lists of long integers stored on a text files, i.e. which
reads like
"7359700484475972"
"7359700484475972"
"0"
"7359700484475972"
"0"
"0"
"0"
"97189954101318722"
"0"
"0"
"7811896690636354"
2009 Apr 01
1
Latex symbols in R (\perp and \parallel)
Dear All,
I am sure this is a one-liner, but I cannot find the R command to
generate the LaTex symbols \perp and \parallel. Consider for instance
the figure
(one can use any kind of data for the plot)
pdf("friction_linear_chain_perpendicular.pdf")
par( mar = c(4.5,5, 2, 1) + 0.1)
plot(data[ ,1], data[
2012 Feb 19
1
World Heat/Rainbow Map
Dear All,
I would like to do the following: make a plot of the world and color a few selected states.
Some states have an associated scalar (i.e a simple number) and I would like to paint them using a heat map and show legend for the color map in the plot. One or two states do not have any number associated to them and are simply colored/filled according to a distinctive pattern that I choose.
To
2019 Jul 09
3
[R] Curl4, Quantmod, tseries and forecast
Hi Ralf,
I tried the following
> install.packages("RCurl")
which went OK, but then same story when I tried to install tseries.
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 10 (buster)
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
LAPACK:
2013 Mar 24
3
Parallelizing GBM
Dear All,
I am far from being a guru about parallel programming.
Most of the time, I rely or randomForest for data mining large datasets.
I would like to give a try also to the gradient boosted methods in GBM,
but I have a need for parallelization.
I normally rely on gbm.fit for speed reasons, and I usually call it this
way
gbm_model <- gbm.fit(trainRF,prices_train,
offset = NULL,
misc =
2009 Jul 20
3
Histograms on a log scale
Dear All,
I would like to be able to plot histograms/densities on a semi-log or
log-log scale.
I found several suggestions online
http://tolstoy.newcastle.edu.au/R/help/05/09/12044.html
https://stat.ethz.ch/pipermail/r-help/2002-June/022295.html
http://www.harding.edu/fmccown/R/#histograms
Now, consider the code snippet taken from
http://www.harding.edu/fmccown/R/#histograms
# Get a random
2011 Dec 15
3
From Distance Matrix to 2D coordinates
Dear All,
I am struggling with the following problem: I am given a NxN symmetric
matrix P ( P[i,i]=0, i=1...N and P[i,j]>0 for i!=j) which stands for the
relative distances of N points.
I would like use it to get the coordinates of the N points in a 2D
plane. Of course, the solution is not unique (given one solution, I can
translate or rotate all the points by the same amount and generate
2007 Aug 08
2
Relocating Axis Label/Title --2
Apologies for the previous mail (I sent it off too early by mistake).
This is the correct example:
rm(list=ls())
D_mean<-seq(-5,5,length=100)
y<-exp(-D_mean^2/5)
pdf("my.pdf")
plot(D_mean,y,type="l",yaxt="n",lty=2,lwd=2,col="black",
ylab = list(expression(paste(dN/dlogD[agg]," ["*cm^-3*"]"))),
xlab = expression(paste(D[agg],"
2012 Oct 26
2
Stata Database & R
Dear All,
I am given some data to analyze. The data is in the form of a Stata
database (.dta file).
What is the best way to import it into an R dataframe?
Is there any particular caveat I should be aware of?
Many thanks
Lorenzo
2018 Jan 30
0
Simulation based on runif to get mean
On 1/29/2018 9:03 PM, smart hendsome via R-help wrote:
> Hello everyone,
> I have a question regarding simulating based on runif.? Let say I have generated matrix A and B based on runif. Then I find mean for each matrix A and matrix B.? I want this process to be done let say 10 times. Anyone can help me.? Actually I want make the function that I can play around with the number of simulation
2012 Oct 05
2
Test for Random Points on a Sphere
Dear All,
I implemented an algorithm for (uniform) random rotations.
In order to test it, I can apply it to a unit vector (0,0,1) in Cartesian
coordinates.
The result is supposed to be a set of random, uniformly distributed,
points on a sphere (not the point of the algorithm, but a way to test it).
This is what the points look like when I plot them, but other then
eyeballing them, can anyone
2013 Mar 25
2
Reassign Multiple Factors to same Factor Value
Dear All,
Probably something very easy, but I am looking for the most efficient ways
to achieve this.
Consider the following snippet
y<-c('a','b','c','d','e','f','g')
x<-rnorm(length(y))
df<-data.frame(y,x)
leading to
> df$y
[1] a b c d e f g
Levels: a b c d e f g
Now, I would like to replace levels
2013 Jan 28
1
RandomForest and Missing Values
Dear All,
I would like to use a randomForest algorithm on a dataset.
The set is not particularly large/difficult to handle, but it has some
missing values (both factors and numerical values).
According to what I found
https://stat.ethz.ch/pipermail/r-help/2005-September/078880.html
https://stat.ethz.ch/pipermail/r-help/2007-January/123117.html
the randomForest package has a problem with missing
2016 Apr 19
3
Problem with X11
Dear All,
I have never had this problem before. I run debian testing on my box
and I have recently update my R environment.
Now, see what happens when I try the most trivial of all plots
> plot(seq(22))
Error in (function (display = "", width, height, pointsize, gamma, bg,
:
X11 module cannot be loaded
In addition: Warning message:
In (function (display = "", width,
2010 Feb 26
3
Plotting a Trivial Matrix
Dear All,
Consider a matrix (N x N) where each entry is either zero or one (can
hardly get any simpler).
Now, I would like to plot it as a 'chessboard' where every matrix entry
is a black (1) or white (0) square.
Whatever tool I use to plot it, it should not try to interpolate the
data at all.
I found some online references
http://www.phaget4.org/R/image_matrix.html
but probably I can
2018 Jan 30
1
Simulation based on runif to get mean
Hello,
Another way would be to use ?replicate and ?colMeans.
set.seed(2511) # Make the results reproducible
fun <- function(n){
f <- function(){
a <- runif(5, 1, 10)
b <- runif(5, 10, 20)
colMeans(cbind(a, b))
}
replicate(n, f())
}
fun(10)
Hope this helps,
Rui Barradas
On 1/30/2018 8:58 AM, Daniel Nordlund wrote:
> On 1/29/2018
2007 Apr 05
17
Reasons to Use R
Dear All,
The institute I work for is organizing an internal workshop for High
Performance Computing (HPC).
I am planning to attend it and talk a bit about fluid dynamics, but
there is also quite a lot of interest devoted to data post-processing
and management of huge data sets.
A lot of people are interested in image processing/pattern recognition
and statistic applied to geography/ecology, but I
2019 Jul 07
2
Curl4, Quantmod, tseries and forecast
Dear All,
I have just upgraded to Debian stable 10 and rebuilt most of the R
packages.
I use the R backported packages from here
https://cran.r-project.org/bin/linux/debian/#debian-buster-testing
for the core system.
I encounter some issues when updating quantmod, tseries and forecast.
For instance, see the following
> install.packages("tseries")
which finally fails with the
2019 Jul 07
2
Curl4, Quantmod, tseries and forecast
Dear All,
I have just upgraded to Debian stable 10 and rebuilt most of the R
packages.
I use the R backported packages from here
https://cran.r-project.org/bin/linux/debian/#debian-buster-testing
for the core system.
I encounter some issues when updating quantmod, tseries and forecast.
For instance, see the following
> install.packages("tseries")
which finally fails with the
2013 Feb 03
3
RandomForest, Party and Memory Management
Dear All,
For a data mining project, I am relying heavily on the RandomForest and
Party packages.
Due to the large size of the data set, I have often memory problems (in
particular with the Party package; RandomForest seems to use less memory).
I really have two questions at this point
1) Please see how I am using the Party and RandomForest packages. Any
comment is welcome and useful.