Displaying 20 results from an estimated 20000 matches similar to: "How to remove non-UTF-8 characters from a string"
2008 Aug 20
1
How to send Html using SQL Server db mail
All,
I have a variable called `go` and it has a single quote in the name
column of line 47 that I am trying to get rid of. I have tried using
gsub, but I cannot get the syntax correct to tell R to remove the '
(single quote).
> go[47,]
gvkey Symbol Name Rank MarketCap MemoDate
Action Analyst Reason SharesHeld
75 065105 BJ BJ'S WHOLESALE CLUB INC 0.9579
2007 Feb 22
3
How to print a double quote
Can anyone tell me how to get R to include a double quote in the middle
of a character string?
For example, the following code is close:
> fnd<-"Open fnd 'test'"
> cat(fnd)
Open fnd 'test'>
>
But instead of Open fnd 'test' I need: Open fnd "test". Difference
seems minor, but I am writing batch files for another
2007 May 24
1
how to change font size in HTML output
I have not been able to figure out how to change the font size for
R2HTML::HTML output. Or for output from prettyR::htmlize. If anyone
can give me a couple hints that would be great.
Thanks,
Roger J. Bos
********************************************************************** *
This message is for the named person's use only. It may
contain confidential, proprietary or legally
2007 May 24
1
Is it possible to print a data.frame without the row names?
Is it possible to print a data.frame without the row names? I checked
?data.frame, ?print, ?format and didn't see anything that helped. In
the example below, I would just like to show the two columns of data and
not the row.names 1:10.
> a<-data.frame(1:10, 21:30)
> a
X1.10 X21.30
1 1 21
2 2 22
3 3 23
4 4 24
5 5 25
6 6 26
7
2008 May 02
1
How to parse XML
I would like to learn how to parse a mixed text/xml document I
downloaded from the sec.gov website (see example below). I would like
to parse this to get the value for each xml tag and then access it
within R, but I don't know much about xml so I don't even know where to
start debugging the errors I am getting in this example code. Can
anyone help me get started?
Thanks, Roger
ftp
2007 Mar 01
2
FTP download from ftp.sec.gov
All,
I have managed to download files from web sites and ftp sites using R,
so just for fun I tried to do so from the SEC's ftp site using the
following code:
ftp <- "ftp://anonymous:test at ftp.sec.gov/edgar/full-index/company.idx"
download.file(url=ftp, destfile="test.txt")
And it does not work. R says it cannot open the URL. If I paste the ftp
part into IE it
2009 Nov 20
3
Remove leading and trailing white spaces
I have a character string and I would like to remove the leading and
tailing white spaces. The example for 'sub' shows how to remove the
trailing white spaces, but I still can't figure out how to remove both
trailing and leading white spaces because I can't find any documentation
for what "+$" means or what "\\s+$" means. Maybe its because I don't
have a
2012 Feb 15
1
LaTeX and Sweave on windows
I am completely new to LaTeX and Sweave, so I am trying to follow the
tutorial in the following link:
http://www.r-bloggers.com/using-latex-r-and-sweave-to-create-reports-in-
windows/
I installed MiKTeX 2.9 and TeXnicCenter, but I get a build error when
compiler the example file:
The two errors are: "Error: running 'texi2dvi' on 'test.tex' failed" and
"R> !
2008 Aug 16
1
How to remove white spaces
All,
I am storing a string of email addresses in a table and when I retrieve
them using a RODBC statement such as:
test = sqlQuery(xf, "select specialist from
roger_sector_specialist")$specialist
'test' is of mode list and includes a bunch of white space. As a
work-around I convert 'test' to a character string, split it based on a
white space, then take the first
2007 Mar 21
0
Unable to register TclNotifier window class
Running R 2.4.1 in batch mode on a Windows Server 2003 machine
occasionally gives me the following error in the ".Rout" file:
Loading required package: tcltk
Loading Tcl/Tk interface ... Unable to register TclNotifier window class
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
Does
2011 Sep 08
3
How to specify a variable name in the regression formula without hard coding it
I have a matrix called mat and y is the column number of my response and
x is a vector of the column numbers of my terms. The variable name of y
can change, so I don't want to hardcode it. I can find out the name as
follows:
> names(mat)[y]
[1] "er12.l"
Then I can run the regression by hard coding the variable name as
follows:
> mod <-
2011 Sep 19
1
Constrained regressions (suggestions welcome)
All,
Could anyone recommend a package that allows the user to constrain the
coefficients from a multiple regression equation?
I tried using the gl1ce function in lasso2, but couldn't get it to
work. I created a contrived example to illustrate my starting point.
data(cars)
fmla <- formula(dist ~ speed)
gl1c.E <- gl1ce(fmla, data = cars)
gl1c.E
gl1c.E <- gl1ce(fmla, data =
2010 Aug 26
3
Help with ddply to eliminate a for..loop
I created a small example to show something that I do a lot of. "scale"
data by month and return a data.frame with the output. "id" represents
repeated observations over "time" and I want to scale the "slope"
variable. The "out" variable shows the output I want. My for..loop
does the job but is probably very slow versus other methods. ddply
2005 Nov 03
1
vcedit on non-vorbisI streams
I've been looking at modifying vcedit so it will
work on Ogg streams containing primarily Vorbis
data (i.e. first page is the Vorbis header, most
pages are Vorbis and a few are something else
e.g. metadata or lyrics).
I've managed to get something that works by:
1. During the header opening in vcedit_open
push non-Vorbis pages onto a buffer added to
vcedit_state and write them out after
2010 Mar 23
2
Creating pdfs using qplot in qqplot2
I am trying to create plots within a for loop and output them to a pdf.
Here is a working example using plot:
gg <- data.frame(datadate=1:4, spread=5:8)
pdf()
for (i in 1:3) {
plot(gg$datadate, gg$spread, main=i)
}
dev.off()
I am trying to learn more about ggplot2 so I try a slight modification
and it doesn't work. Anyone
2011 Sep 06
1
How to speed up regressions (related to data.frame)
All,
I have a function that runs a set of regressions (using the rlm
function) and I notice that it run much slower on my 64-bit R than it
does on my 32-bit R. I guess the bigger bit size slows it down.
Anyway, I looked into Rprof to see how I can speed it up. I saw that
78% of the total time is spent in [.data.frame, so I tried converting my
data to a matrix using data.matrix, but then rlm
2005 Apr 12
8
removing characters from a string
Is there a simple way in R to remove all characters
from a string other than those in a specified set? For
example, I want to keep only the digits 0-9 in a
string.
In general, I have found the string handling abilities
of R a bit limited. (Of course it's great for stats in
general). Is there a good reference on this? Or should
R programmers dump their output to a text file and use
something
2014 Nov 09
1
inbox parameter is ignored within location config for public namespaces?
Hello,
i already asked a similiar question some month ago but still have no
fix for my problem :-(
This is my global location option in 10-mail.conf:
mail_location =
maildir:/home/vmail/%d/%n/MAILDIR:INBOX=/home/vmail/%d/%n/MAILDIR/.INBOX:INDEX=/home/vmail/%d/%n/INDEX/
This works fine, until i'm using a public namespace.
The following namespace is a normal user too, every mail to bos at
2005 Oct 25
8
Can anyone please tell me how to strip the white spaces from a character vector?
for example:
> a$tic[1:10]
[1] "AIR " "ABCB " "ABXA " "ACMR " "ADCT " "ADEX "
[7] "ABM " "AFCE " "AG " "ATG "
Can anyone please tell me how to strip the white spaces from a$tic?
Thanks,
Roger
[[alternative HTML version deleted]]
2011 Jul 12
2
foreach not recognizing functions in memory
All,
I am not understanding the scoping used in foreach when it is used
inside a function. I keep getting "could not find function" errors for
functions that are in memory when I try to use foreach within a function
call. I have a simple example below. "testFun" is in memory and works
when called by foreach directly, but when I place foreach in a function
called