Hi All,
I am trying to parse some information from website, say, a linkedin page.
The linkedin url was
url = http://www.linkedin.com/in/huidu;
I had no problem to use readLines and XML package to collect the
information I need. However, that url became
https://www.linkedin.com/in/huidu; now.
Hi all,
I need to test if a url exists. I used url.exists() in RCurl package
library(RCurl)
however the test result is kind of weird. For example,
url.exists(http://www.amazon.com;)
[1] FALSE
although www.amazon.comhttp://www.amazon.com is a valid url. Does anybody
know how to use that
Hi All,
I have 2 objects, A and B, where
object.size(A) = 5M and object.size(B) = 80M.
However, after I save those two objects as workspaces, say,
save(A, file = A.Rdata) and save(B, file = B.Rdata)
On disk, the size of 'A.Rdata' is 0.22 M but the size of 'B.Rdata' is 560M.
Could someone
Hi All,
My sample code looks like
options(stringsAsFactors = FALSE);
clean = function(x)
{
loc = agrep(ABC, x$name);
x[loc,]$new_name - NEW;
x;
}
name = c(12, dad, dfd);
y = data.frame(name = as.character(name), idx = 1:3);
y$new_name = y$name;
z - clean(y)
The snippet does not
Hi All,
While building a package by 'R CMD INSTALL --build my-own-pack-name', I always
got an error like
Error in normalizePathpath.expandpath, winslash, mustWork:
path[1] = ./DESCRIPTION: Access is denied.
I checked the permission of my DESCRIPTION file and it looks right. Does
anybody
Hi All,
I have R 64bit and R-32 bit installed in my windows 7.
For 64 bit, the version info is
R.Version()
$platform
[1] x86_64-w64-mingw32
$arch
[1] x86_64
$os
[1] mingw32
$system
[1] x86_64, mingw32
$status
[1]
$major
[1] 3
$minor
[1] 0.2
$year
[1] 2013
$month
[1] 09
$day
[1] 25
Hi All,
I have a question about plotting graphs. Supposedly, I want to plot 12 graphs.
Putting 12 graphs to one window seems too crowded. Ideally, I want to put 4
pictures in one window and plot them in three separate window. For exmaple, my
psuedo code is like
par(mfrow = c(2, 2))
for( I
Hi All,
I need some help regarding how to set up a breakpoint in debug. For example, I
have a very simple/naïve function (a useless function just for demo)
f = function()
{
x = 10;
len = 100;
a = 1;
for(i in 1:len)
{
a = a * i;
}
y = x + a;
y;
}
If I need to
Hi R-community:
I heard 'snow' package is a good tool to parallelize processes and speed them
up. I tried to use it but was not successful. Could someboy point where I was
wrong? Thanks.
I want to read a HUGE file to R and hope 'snow' helps me to speed it up. Here
are codes:
library(snow)
Hi All,
How to read a URL requiring log in info in R? For example, I want to download
some info from Linkedin pages, my username is abc, password is 123. How can I
download my desired URL page in R?
Many thanks.
HXD
[[alternative HTML version deleted]]
Hi All,
We have tried to install R in AIX. But it seems the installation is not
complete because when we run R, we always get an error message like
XXXR
Error in objects(i, all.names = TRUE) : failed to open ICU collator
And if we want to install a new package, we get
install.packages
Hi All,
I have data set like
x = data.frame(id = 1:8, f1 = LETTERS[1:8])
I want to replace id 5, 6, 7, 8 by 1, 2, 3, 4 respectively. e.g the map is
ID-1
ID-2
5
1
6
2
7
3
8
4
I have lots of data and rules. How to do it in a few lines rather than do them
one by one like:
x[x$id ==
Hi All,
I have a question about package installation in R. We have developed a package,
say 'ABC'. We have installed it in two machines, A and B by running 'Install
Package(s) from local zip file'. Everything was fine. Right now, suppose that
package got damaged in machine A and our zipped
Hi All,
I have a matrix like
m - matrix( letters[1:10], ncol=5)
How to conver it to 10 * 3 matrix, which the first col is row index of m,
second col is colum index of m and third column is the value of matrix, say
11 1a
21 2 c
1 3 e
etc...
Thanks.
Hi all,
I am planning to parse some information on a website which includes lots of
Chinese characters. Does someone know how to read/display Chinese in R? Thanks.
url = http://www.teec.org.cn/html/renwujieshao/;
x = readLines(url)
I tried encoding = 'UTF-8' already but it didn't help.
My R
Thanks a lot.
y - iconv(x, gb2312, utf-8) does not work but
y - iconv(x, gb2312, UTF8) works on my machine. Thank you for pointing to
the right direction.
-Original Message-
From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
Sent: Wednesday, January 23, 2013 6:16 PM
To: Hui Du
Hi group:
I have a data set, which has severe colinearity problem. While running linear
regression in R and SPSS, I got different models. I am wondering if somebody
knows how to make the two software output the same results. (I guess the way R
and SPSS handling singularity is different, which
Hi All,
I know in R there is function named 'step', which does the stepwise regression
and choose the model by AIC. However, if I want to choose a model per this
logic:
1. Run a full model (linear regression, f = lm(y ~., data = ZZZ), for
example)
2. Pick up the variable with
Hi All,
I need to calculate VIF (variance inflation factor) for my linear regression
model. I found there was a function named vif in 'HH' package. I have two
questions:
1) I was able to install that package in my R under windows. But while
trying to install that package in UNIX, I
Thanks. But in UNIX side, I got the same error
In getDependencies(pkgs, dependencies, available, lib) :
package ââ¬Ëcarââ¬â¢ is not available
HXD
From: Jorge I Velez [mailto:jorgeivanve...@gmail.com]
Sent: Wednesday, July 11, 2012 3:19 PM
To: Hui Du
Cc: R-help
Subject: Re: [R] Variance
To: Hui Du
Cc: R-help
Subject: Re: [R] Variance Inflation factor
Could you please include your sessionInfo() ?
Thank you,
Jorge.-
On Wed, Jul 11, 2012 at 6:27 PM, Hui Du
hui...@dataventures.commailto:hui...@dataventures.com wrote:
Thanks. But in UNIX side, I got the same error
Message-
From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com]
Sent: Wednesday, July 11, 2012 4:04 PM
To: Hui Du
Cc: Jorge I Velez; R-help
Subject: Re: [R] Variance Inflation factor
You're rather out of date with your version of R -- if you want to use
the CRAN binaries provided
Hi All,
I have two questions regarding install.packages().
Q1: may I run it in non-interactive mode, which means just install the packages
I want rather than letting me to choose which mirror etc?
Q2: I ran a R code in batch mode, for example, R CMD BATCH a.r
In a.r, I have some statements
Thanks Sarah.
I realized it as well and tried to run install.packages(plyr, lib = .Library)
as root. It works now.
Thanks again.
HXD
-Original Message-
From: Sarah Goslee [mailto:sarah.gos...@gmail.com]
Sent: Monday, July 09, 2012 12:06 PM
To: Hui Du
Cc: r-help@r-project.org
Subject
Dear All,
This question sounds very simple but I don't know where I am wrong. I just want
to pad leading zeros in some string, for example, 123 becomes 00123. What
is wrong if I do following?
sprintf(%05s, 123)
[1] 123
It didn't return 00123, instead it padded with 'blank'.
Thank you
...@gmail.com]
Sent: Tuesday, May 22, 2012 12:00 PM
To: Sarah Goslee
Cc: Hui Du; r-help@r-project.org
Subject: Re: [R] pad leading zeros in front of strings
I get 00123 and 00abc respectively. Agreed it's perhaps odd, but
c'est la OS.
M
On Tue, May 22, 2012 at 2:57 PM, Sarah Goslee sarah.gos
Hi All,
Suppose I have the following codes:
x = data.frame(A = rnorm(20), B = rnorm(20), C = rnorm(20))
a = list()
a[[1.1]] = x
a[[1.2]] = x
b = list()
b[[1.1]] = c(A, B)
b[[1.2]] = c(B, C)
Now I want to apply b to a like this, for each element of 'a', only select the
corresponding columns
Hi All,
I have a self-cooked package and save it to a zip file after
running make, say named xxx.zip. After installing it to R by running Install
packages from local zip files under Packages menu in R (Windows), I realized I
needed to change some source codes and re-make it. My
Hi All,
I am pretty new for RODBC. I want to save my table to a DB, so I
used something like
sqlSave(db, a, 'Forecast_Result', rownames = FALSE);
But I got an error
Error in sqlSave(db, a, Forecast_Result, rownames = FALSE) :
table 'Forecast_Result' already exists
Yes, that
Hi All,
I have a data frame, whose colnames like A.x, B.x, C.x, A.y,
B.y, C.y. There could be many columns like this pattern. I want to compare
data in columns A.x with A.y, B.x with B.y and C.x with C.y etc.
Suppose my data frame is d,
names(d) = c(A.x, B.x, C.x, A.y, B.y,
Hi List,
I have a question regarding debug R code. I know I can use
debug(fuction_name) and when code runs to that point, it will go to debugger.
My question is inside debugger, how to stop a code at a specified line. For
example, in C (gdb or dbx debugger) I can run stop at 123
Hi All,
Does somebody know how to know the detail of the line types?
For example, lty = 1, means what kind of line?, lty = 2, means what kind of
line?
Thanks.
HXD
[[alternative HTML version deleted]]
__
Hi all,
I want to run a R code in the batch mode under UNIX system.
Inside that code, I have a usage() function to give the hints regarding
parameters. For example
usage = function()
{
msg = R CMD BATCH --save \--args path=\\\input_path\\\
file=\\\input_file\\\
Hi All,
Suppose I have data like
b[[1]] = matrix(1:4, 2, 2)
b[[2]] = matrix(10:13, 2, 2)
b[[3]] = matrix(20:23, 2, 2)
[[1]]
[,1] [,2]
[1,]13
[2,]24
[[2]]
[,1] [,2]
[1,] 10 12
[2,] 11 13
[[3]]
[,1] [,2]
[1,] 20 22
[2,] 21 23
Hi All,
Suppose I have data like
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
, like a, b c, a bdfd c and def e h in my
example. It is not necessary just three letters, so substr may not work.
Sorry for the confusion.
HXD
From: Dennis Murphy [mailto:djmu...@gmail.com]
Sent: Wednesday, March 09, 2011 11:30 PM
To: Hui Du
Cc: r-help@r-project.org
Subject: Re: [R] aggregate
Hi All,
I have a data frame like
a = data.frame(date = c(20081201, 20081202, 20081201), product = c(a b c d e,
a b c g h t, d e h a c e h g), sales = c(1, 2, 3))
Now I want to aggregate the sales by part of the a$product.
'Product' is the product name, a
Hi All,
I have two Rs, one has been installed in Windows system and
another one has been installed under UNIX system. Is there any environmental
variable or function to tell me which R I am using? The reason that I need to
know it is under different system, the data path could
Great. Thanks.
Best Regards,
Hui Du
Data Ventures Inc
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Friday, February 25, 2011 12:59 PM
To: Hui Du
Cc: r-help@r-project.org
Subject: Re: [R] R in different OS
On Feb 25, 2011, at 1:23 PM, Hui Du wrote
Hi All,
The following is a snippet of my code. It works fine but it is very slow. Is it
possible to speed it up by using different data structure or better solution?
For 4 runs, it takes 8 minutes now. Thanks a lot
fun_activation = function(s_k, s_hat, x_k, s_hat_len)
{
common =
Hi all,
I have a dataset. Each time I want to sample N(i) elements from
it and I want to repeated sampling M times. N(i) is varied from time to time.
For example,
dataset = 1:50;
a = list();
M = 1000;
I want to
41 matches
Mail list logo