Hi Joe,
I have read your question with great interest. I am a little bit astonished to
read about your project. There is a big national institute in Germany called
GESIS
(https://de.wikipedia.org/wiki/GESIS_%E2%80%93_Leibniz-Institut_f%C3%BCr_Sozialwissenschaften)
which does the same job you a
Hi Ulrik,
many thanks for your reply. I had to take an unplanned break and was not
in the office during the last two weeks. Thus my late reply.
I followed your advice and converted the variable in argument "fill" to
factor. Now the color change works:
-- cut --
d_result <- structure(list("var
Hi David,
many thanks for your answer.
I followed your suggesting and came up with the following code:
-- cut --
ggplot(
d_result,
aes(x = variable, y = n, fill = value)) +
geom_bar(
stat = "identity") +
coord_cartesian(ylim = c(0,100)) +
coord_flip() +
scale_y_continuous(name =
Hi All,
I have the following code:
-- cut
(g03_02_p02 <- ggplot(data = d_kzb_input) +
geom_bar(
mapping = aes(x = v03_02_r01, y = round(..prop.. * 100, 0)),
fill = c_ww_palette["blue"]) +
scale_y_continuous(limits = c(0, c_y_limit)) +
theme_classic() +
ggtitle(paste0("Question 3
Hi All,
some time ago I asded a question about the places where RStudio stores it
configuration information. I came across this posting
https://support.rstudio.com/hc/en-us/articles/206382178?version=1.0.136&mode=desktop
explaining RStudio keybindings (predefined and customized). At the end of
Hi All,
in my current project I am working with multiple-response questions
(MRSets):
-- Coding --
100 Main Code 1
110 Sub Code 1.1
120 Sub Code 1.2
130 Sub Code 1.3
200 Main Code 2
210 Sub Code 2.1
220 Sub Code 2.2
230 Sub Code 2.3
300 Main Code 3
310 Sub Code 3.1
320 Sub Code 3.2
The coding
Hi Bert,
many thanks for your reply. I appreciate your help a lot.
I would like to do the operation (= finding the duplicates) row-wise.
During this night a solution showed up in my dreams :) Instead of using
duplicates() to flag and filter the values I could use unique instead with
the same r
Hi Bert,
many thanks for your reply. I appreciate your help a lot.
I would like to do the operation (= finding the duplicates) row-wise.
During this night a solution showed up in my dreams :) Instead of using
duplicates() to flag and filter the values I could use unique instead with
the same r
Hi All,
I am using factors in a study for the social sciences.
I discovered the following:
-- cut --
library(dplyr)
test1 <- c(rep(1, 4), rep(0, 6))
d_test1 <- data.frame(test)
test2 <- factor(test1)
d_test2 <- data.frame(test2)
test3 <- factor(test1,
levels = c(0, 1),
Hi Bob,
many thanks for your reply.
I have read the documentation. In my current project I use "item
batteries" for dimensions of touchpoints which are rated by our customers.
I wrote functions to analyse them. If I create a factor before filtering
and analysing I lose the original values of t
Hi David,
Hi Bob,
many thanks for your help.
Your solution - just to use all levels instead of just the one's found in
the data - helped.
The original code looked like this:
-- cut --
c_v10_val_labs <- c(
"1 = sehr gut",
"2", "3", "4", "5",
"6 = sehr schlecht"
)
# where c_v10_val_labs
Hi All,
this post is somewhat off-topic cause it deals with a meta issue related to
project organisation instead of real R code.
I have updated my blog concerning a possible directory and file structure for
marketing research projects and data mining projects alike:
https://github.com/gmaubach
Hi All,
I would like to do the following pie chart using ggplot from an official
data source (
http://www.deutscheweine.de/fileadmin/user_upload/Website/Service/Downloads/Statistik_2016-2017-neu.pdf
, Tab 8, Page 14):
-- cut --
cat("# weinimport_piechart.R\n")
# -- Input -
Hi All,
I try to do a scatterplot for a bunch of variables. I plot a dependent
variable against a bunch of independent variables:
-- cut --
graphics::plot(
v01_r01 ~ v08_01_up11,
data = dataset,
xlab = "Dependent",
ylab = "Independent #1"
)
-- cut --
It is tedious to repeat the stateme
Hi All,
I have to compile a report for the management and decided to use RMarkdown
and knitr. I compiled all needed plots (using separate R scripts) before
compiling the report, thus all plots reside in my graphics directory. The
RMarkdown report needs to access these files. I have defined
```
Hi Yihui,
Hi Duncan,
I corrected my typo. Unfortunately knitr did not find my plots in the
directory where they reside which is different from the Rmd document.
The documentation of knitr says:
base.dir: (NULL) an absolute directory under which the plots are generate
root.dir: (NULL) the root d
Hi Yihui,
I took root.dir and base.dir out. Everything works fine despite the
change.
I have implemented the solution Duncun suggested. I have difficulties with
the scaling / image size in my report. Some plots are too big, some are
too small. I need to adjust any plot. Steep learning curve :)
Hi Dan,
Hi All,
I read the below post. I am wondering how do I know which "keys" are
available, e.g. "core.r" and "pre". Where kind I find the definition of
what can be adjusted and which "words" to use?
Kind regards
Georg
> Gesendet: Donnerstag, 08. Juni 2017 um 16:16 Uhr
> Von: "Nordlund,
# Hi All,
#
# I have the following data frame (example):
Debitor <- c("968691", "968691", "968691",
"A04046", "A04046",
"L0006", "L0006", "L0006",
"L0023", "L0023",
"L0056", "L0056",
"L0094", "L0094", "L0094",
"L0124",
Hi All,
the solution for my question is as follows
## Filter duplicates and correpsonding non-duplicates
### To filter duplicates and their corresponding non-duplicates use the
### following code snippet:
Debitor <- c("968691", "968691", "968691",
"A04046", "A04046",
"L0
Hi All,
I need to create a data frame from scratch and fill variables created on the
fly with values. What I have so far:
-- schnipp --
# Example dataset
gene <-
c("ENSG0208234","ENSG0199674","ENSG0221622","ENSG0207604",
"ENSG0207431","ENSG0221312","ENSG00134940305",
Hi Dan,
Hi All,
many thanks for your help.
Please find enclosed my little function for your use:
-- cut --
#---
# Module: t_count_na.R
# Author: Georg Maubach
# Date : 2016-05-24
# Update
Hi All,
I thought dataset$variable is the same as dataset["variable"]. I tried the
following:
> str(ZWW_Kunden$Branche)
chr [1:49673] "231" "151" "151" "231" "231" "111" "231" "111" "231" "231"
"151" "111" ...
> str(ZWW_Kunden["Branche"])
'data.frame':49673 obs. of 1 variable:
$
Hi All,
I am using R for social sciences. In this field I am used to use short
variable names like "q1" for question 1, "q2" for question 2 and so on and
label the variables like q1 : "Please tell us your age" or q2 : "Could you
state us your household income?" or something similar indicating w
Hi All,
I was new to R and this list a couple of mounths ago. When processing my
data I got tremendous support from R-Help mailing list.
The solutions I have worked out with your help might be also helpful for
others. I have put the solutions in a couple of small functions with
documentation a
Hi All,
I am installng miniCRAN on Debian GNU Linux 8 Jessie (Linux analytics7
4.5.0-0.bpo.2-amd64 #1 SMP Debian 4.5.4-1~bpo8+1 (2016-05-13) x86_64 GNU/Linux)
and R 3.3.0
-- cut --
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Lin
Hi all,
I did it today on Debian GNU Linux 8 Jessie this way:
vim /etc/apt/sources.list
deb http://cran.uni-muenster.de/bin/linux/debian jessie-cran3
ESC;:wq
apt.get update
apt-get install r-base r-base-dev
This worked for me.
When installing R packages from within R I found that R needed the
Hi Petr,
I am looking for a general procedure that I can use with any package of R.
As to my current experience it probably will happen that I need a
procedure from another package than hmisc or memisc and the my solution
shall work even than so that I do need to find another way to do it.
Kin
Hi Jim,
many thanks for the hint.
When looking at the documentation I did not get how I do control which
value gets which label. Is it possible to define it?
Kind regards
Georg
Von:Jim Lemon
An: g.maub...@weinwolf.de, r-help mailing list ,
Datum: 01.06.2016 03:59
Betreff:
Hi All,
I merged two datasets:
ds_merge1 <- merge(x = ds_bw_customer_4_match, y =
ds_zww_customer_4_match,
by.x = "customer", by.y = "customer",
all.x = TRUE, all.y = FALSE)
R created a new dataset with the variables customer.x and customer.y. I
would like to merge these two variable back
Hi David,
Hi Petr,
many thanks for your help. With your hints I got the idea how I could do
it and I came up with this solution:
-- cut --
#---
# Module: t_merge_variables.R
# Author: Georg Maubach
# Dat
Hi Michael,
yes, I was astonished about this behaviour either. I have worked with SPSS
a lot - and that works different.
I would like to share some of my data. Can you tell me how I can dump a
dataset in a way that I can post it here as text?
Kind regards
Georg
Von:Michael Dewey
An:
Hi Petr,
I would like to describe the data situation in brief:
I have an business warehouse dataset (referred to as BW data) containing
sales and an ERP customer master data dataset with additional information
(referred to as ERP data). Though customer IDs and customer names are
identical due
Hi Petr,
thanks for your reply.
I prepared little example for you:
-- cut --
ds_temp_1 <-
structure(list(
CustId = c(1001, 1002, 1003, 1004, 1005, 1006),
CustName = c("Miller", "Smith", "Doe", "White", "Black",
"Nobody"),
sales = c(100, 500, 300, 50, 700, 10)
),
Hi All,
I get the warning message
Warning message:
In styles$font : partial match of 'font' to 'fonts'
when executing
> xls_workbook <- t_create_workbook()
> xls_sheetname <- "Kunden"
> xls_ds_to_save <- ds_merge1
> xls_filename <- paste0(data_created,
"_Merge1_BW-SAP-Kunden_cleaned.xlsx")
>
Hi all,
today I wanted to install package "rio". As it depends on package "feather"
which is only available as source I have chosen to install "rio" from source.
The installations fails with the following messages:
-- cut --
* installing *source* package 'feather' ...
** Paket 'feather' erfolgr
Hi All,
I need to build a binary vector made of a set of dichotomous variables.
What I have so far is:
-- cut --
ds_example <-
structure(
list(
year2013 = c(0, 0, 0, 1, 1, 1, 1, 0),
year2014 = c(0,
0, 1, 1, 0, 0, 1, 1),
year2015 = c(0, 1, 1, 1, 0, 1, 0
> Hi Tom,
>
> thanks for your reply.
>
> Yes, that's exactly what I am looking for. I did not know about the automatic
> type conversion in R.
>
> #-- cut --
> ds_example <-
> structure(
> list(
> year2013 = c(0, 0, 0, 1, 1, 1, 1, 0),
> year2014 = c(0,
>0,
Hi All,
today I would like to announce a now R blog. I contains a few entries
about the findings during my course of studies and my daily work:
https://github.com/gmaubach/R-Know-How/wiki/R-Blog
I hope you'll find my hints usefull.
In addition you could have a look at a small R collection of f
Hi All,
I would like to recode my NAs to 0. Using a single vector everything is
fine.
But if I use a data.frame things go wrong:
-- cut --
var1 <- c(1:3, NA, 5:7, NA, 9:10)
var2 <- c(1:3, NA, 5:7, NA, 9:10)
ds_test <-
data.frame(var1, var2)
test <- var1
test[is.na(test)] <- 0
test # NA rec
Hi folks,
I have updated the functions of the r_toolbox.R set of utilities:
https://sourceforge.net/projects/r-project-utilities/files/?source=navbar
Naming was changed with some functions to reflect similar functions in SAS
or SPSS, e. g. t_n_miss, t_n_valid. In addition I added functions for
Hi Bert,
many thanks for all your help and your comments. I learn at lot this way.
My question was about is.na() at the first sight but the actual task looks like
this:
I have two variables in my customer data that signal if the customer accout was
closed by master data management or by sales.
Hi David,
Hi Bert,
many thanks for the valuable discussion on NA in R (please see extract
below). I follow your arguments leaving NA as they are for most of the
time. In special occasions however I want to replace the NA with another
value. To preserve the newly acquired knowledge for me I wrot
Hi Petr,
many thanks for your reply and the examples.
My subscripting problems drive me nuts.
I have understood that dataset[variable] is semantically identical to
dataset[, variable] cause dataset[variable] takes all cases because no
other subscripts are given.
Where can I lookup the rules w
Hi All,
Petr, Bert, David, Ivan, Duncan and Rui helped me to develop a function
able to replace NA's in variables IF NEEDED:
#---
# Module: t_replace_na.R
# Author: Georg Maubach
# Date : 2016-06
Hi All,
I would like to install R packages from source on Windows 7 64-Bit.
Currently my settings are:
-- cut --
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=German_Germany.
Hi Duncan,
many thanks for your reply.
I did insert die paths to the g++ compiler because I got the message about
the not existent compiler.
I took the directories for the compiler out again:
C:\R-Project\Rtools\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program
Files\Python 3.5\Scripts\;C:\P
Hi Duncan,
indeed, I did not see the other part of your message.
I did
BINPREF ?= C:/R-Project/Rtools/mingw_32/bin/
COMPILED_BY = g++ # instead of gcc-4.9.3
in "C:\R-Project\R-3.3.0\etc\i386\Makeconf"
and
BINPREF ?= C:/R-Project/Rtools/mingw_64/bin/
COMPILED_BY = g++ # instead of gcc-4.9.3
i
Hi Duncan,
I would not have changed the COMPILED_BY option unless I thought I have
to.
In my "C:\R-Project\Rtools\mingw_32\bin" I have
c++.exe
g++.exe
gcc.exe
i686-w64-mingw32-c++.exe
i686-w64-mingw32-g++.exe
i686-w64-mingw32-gcc-4.9.3.exe
i686-w64-mingw32-gcc.exe
In my "C:\R-Project\Rtools\m
Hi All,
I am using excel.link to work seemslessly with Excel.
In addition to values, like numbers and strings, I would like to insert a
full operational formula into a cell.
xlc["G14"] <- print(paste("=G9*100/G6"), quote = FALSE)
The strings is put into the cell, but the cell is not evaluate
Hi Pito,
Dear Readers,
as other have already mentioned, there are good practices for documenting code
and data. I would like to summarize them and add a few not mentioned earlier:
1. You should have always two things: your raw data and your R script/s. The
raw data is immutable whereas the R sc
Hi Bert,
Hi Readers,
I did not know much about attributes in R and how to use them. If it is that
flexible you are right and I have learnt something.
Kind regards
Georg
> Gesendet: Donnerstag, 30. Juni 2016 um 20:06 Uhr
> Von: "Bert Gunter"
> An: g.maub...@gmx.de
> Cc: "Pito Salas" , "R Help"
Dear Readers,
Hi All,
to drive my R knowlegde a bit further I followed the advice of some of you
by reading Chambers: Programming with data.
I tried some examples from the book:
-- cut --
setClass("track", representation (x = "numeric",
y = "numeric"))
trac
Hi Bert,
many thanks.
Found them.
Kind regards
Georg
Von:Bert Gunter
An: g.maub...@weinwolf.de,
Datum: 04.07.2016 16:43
Betreff:Re: [R] Dump of new Methods
?getwd
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and st
Hi guys,
I checked out your example but I can't follow the results.:
> mtcars %>%
+ group_by (am, gear) %>%
+ summarise (n=n()) %>%
+ mutate(rel.freq = paste0(round(100 * n/sum(n), 0), "%")) %>%
+ ungroup() %>%
+ mutate(row.tot = sum(n))
Source: local data frame [4 x 5]
am gear
Hi All,
if I run the suggested code
mtcars %>%
group_by (am, gear) %>%
summarise (n = n()) %>%
mutate(rel.freq = paste0(round(100 * n / sum(n), 0), "%")) %>%
ungroup() %>%
plyr::rbind.fill(data.frame(n = nrow(mtcars), rel.freq =
"100%”))
I
Hi All,
my current code looks lke this:
freq_ls <- structure(list(Var1 = c("zldkkd", "aakdkdk",
"aaakdkd", "aaieiwo", "vöalsl",
"ssddkdk",
"glowowp", "laoiw", "ruklow",
"rolsl",
"delk
Hi All,
Dear Readers,
I need to create a choropleth graph with turnover by zipcode. This is what
I have so far:
# Not run (Begin)
# Install packages if needed
# install.packages(pkgs = c("maptools", "rgdal", "RColorBrewer",
"grDevices"))
# Not run (End)
# Load libraries
library(maptools); libr
Hi All,
I have uploaded a new release of the R Toolbox.
R Toolbox is a collection of simple but useful functions which I developed
for myself to shorten the develoment process. Currently all functions use
base R. No other packages are needed. One exception is "t_openxlsx" cause
this module dea
Hi All,
I try to install packages on Debian GNU Linux 8 (Kernel 3.16.0-4-amd64).
My sessionInfo() is
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
locale:
[1] LC_CTYPE=de_DE.UTF-8 LC_NUMERIC=C
[3] LC_TIME=de_
Hi All,
I need to spread a data.frame on 2 variables, e. g. "channel" and "unit".
If I do it in two steps spreads keeps all cases that does not look like
the one before although it contains the same values for a specific case.
Here is what I have right now:
-- cut --
test1$dummy <- 1
test2 <-
Hi Ulrik,
many thanks for your help.
The problem was that R regards a dataset with a combination like
caseID custID channel unit
1 100010 10
2 100020 10
3 100020
Hi All,
I would like to access an object using a sting.
# Create example dataset
var1 <- c(1, 2, 3)
var2 <- c(4, 5, 6)
data1 <- data.frame(var1, var2)
var3 <- c(7, 8, 9)
var4 <- c(10, 11, 12)
data2 <- data.frame(var3, var4)
save(file = "c:/temp/test.RData", list = c("data1", "data2"))
# Define
Hi All,
I found the function get() which returns an object.
My whole function looks like this:
-- cut --
#---
# Module: t_load_dataset.R
# Author: Georg Maubach
# Date : 2016-08-15
# Update
Hi Greg
and all others who replied to my question,
many thanks for all your answers and help. Currently I store all my
objects in .GlobalEnv = Workspace. I am not yet familiar working with
different environments nor did I see that this would be necessary for my
analysis.
Could you explain why
Hi All,
I try to install RWeka on Debian GNU Linux 8 Jessie (uname -a: 3.16.0-4-amd64
#1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64) which has a dependency
to "rJava".
I did
apt-get install openjdk-8-jre
which went OK.
Java is installed in:
/var/lib/dpkg/alternatives/java
/usr/lib/
Hi All,
I would like to write a program that iterates over a set of dynamically
generated variables and produces some stats or prints parts of the data.
# --- data
v_turnover_2011 <- c(10, 20, 30, 40 , 50)
v_customer_2011 <- c(0, 1, NA, 0, 1)
v_turnover_2012 <- c(10, 20, 30, 40 , 50)
v_customer_
Hi All,
I need to read a bunch of Excel files and store them in R.
I decided to store the different Excel files in data.frames in a named
list where the names are the file names of each file (and that is
different from the sources as far as I can see):
-- cut --
# Sources:
# -
http://stackove
Dear All,
I am new to "R" and search for a solution to exclude cases if a certain
variable contains NA for a case.
Example
No Name Turnover
1 Smith 1500
2 Mayor 200
3 Miller
4 Batic 750
I would like to create a subset excluding case 3 Miller NA.
I tried to following:
new_dataset <- subset(d
Hi All,
I would like to match some datasets. Both deliver variables AND cases
which might or might not be present in all datasets:
This sequence
Kunden <- Kunden_2011
Kunden <- merge(Kunden, Kunden_2012,
by.x = "Debitor", by.y = "Debitor")
Kunden <- merge(Kunden, Kunden_2013,
Hi all,
I would like to use a loop for tasks that occurs repeatedly:
# Groups
# Umsatz <= 0: 1 (NICHT kaufend)
# Umsatz > 0: 2 (kaufend)
for (year in c("2011", "2012", "2013", "2014", "2015")) {
paste0("Kunden$Kunde_real_", year) <- (paste0("Kunden$Umsatz_", year) <= 0) *
1 +
Hi Don,
Hi to all readers,
many thanks for all your answers and all your help.
I adapted Don's code to my data and Don's code does the trick:
str(Kunden01)
for (year in 2011:2015) {
Reeller_Kunde <- paste0("Reeller_Kunde_", year)
Umsatz <- paste0("Umsatz_", year)
cat('Creating', Reeller_K
Hi All,
I need to evaluate missing values in my data. I am able to filter these
values and do simple statistics on it. But I do need new variables based
on variables with missing values in my dataset:
Check_Kunde_2011 <- ifelse(is.na(Umsatz_2011) == TRUE & Kunde_2011 == 1,
1, 0)
Check_Kunde_20
Hi Petr,
Hi Jim,
many thanks for your help. Today I constructed a sample dataset and tested
your suggestions. Everything worked OK.
Then I took the code and testet on the original data. And - it worked OK
this morning also.
I went back to my script of Thuesday and ran it again. OK. Then I used
Hi All,
I am addressing this post to all who are new to R.
When learing R in the last weeks I took some notes for myself to have code
snippets ready for the data analysis process. I put these snippets
together as a script template for future use. Almost all of the given command
prototypes are
Hi All,
my script tries to do the following on factors:
> ## Check for case 3: Umsatz = 0 & Kunde = 1
> for (year in 2011:2015) {
+ Umsatz <- paste0("Umsatz_", year)
+ Kunde <- paste0("Kunde01_", year)
+ Check <- paste0("Check_U_0__Kd_1_", year)
+
+ cat('Creating', Check, 'from', Umsatz,
Hi All,
please find enclosed the missing attachment.
Kind regards
Georg
-- cut --
#-[ Header ]
--
# Program : Framework for R scripts
# Author: Georg Maubach
# Date : 2016-03-03
# Update: 2016-04-27
Hi All,
Hi Carl,
I am not sure if this is useful to you, but I followed your conversation
and thought of you when I read this:
for (i in 1:ncol(dataset)) {
if(class(dataset) == "character|numeric|factor|or whatsoever") {
dataset[, i] <- as.factor(dataset[, i])
}
}
Source: Zumel, Nina / M
Hi Martin,
many thanks for your answer and your broad explanation.
I am a newbie to "R" and got help on this list and thought I could give
something back what looked OK to me.
regarding 0)
You're right, it's pseudo code. I assumed that anybody on the list would
be able to adapt the code to th
Hi All,
I would like to route the output to a file using sink(). When using the
example from the ?sink documentation:
sink("sink-examp.txt")
i <- 1:10
outer(i, i, "*")
sink()
unlink("sink-examp.txt")
## capture all the output to a file.
zz <- file("all.Rout", open = "wt")
sink(zz)
sink(zz, type
Hi Jim,
thanks for your reply.
ad 1)
"all.Rout" was created in the correct directory. It exists properly with
correct file properties on Windows, e.g. creation date and time and file
size information.
ad 2)
I can not access the file with Notepad.exe directly after it was created
by R. The er
Hi Jim,
I tried:
sink("all.Rout")
try(log("a"))
sink()
The program executes without warning or error. The file "all.Rout" is
begin created. Nothing will be written to it. The file is accessable
rights after the execution of the program by notepad.exe.
The program
zz <- file("all.Rout", open
Hi Sarah, John, Jim,
Hi All,
I have set my envrionment variable
path <- file.path("H:", "2016", "Analysis")
setwd(dir = path)
This works well cause the file is created in that directory.
I have tried
close(zz)
unlink(zz)
and neither worked nor did it work out using them together.
I had this
Hi Sarah,
yes, I followed your suggestion.
If I do exactly what is in the example of the documentation:
sink("C:/Temp/sink-examp.txt")
i <- 1:10
outer(i, i, "*")
sink()
unlink("C:/Temp/sink-examp.txt")
it does not write anything, i. e. no file is created in "C:/Temp/". The
script is executed w
Duncan,
thanks for the hint.
I have done it correctly in R fashion
## capture all the output to a file.
zz <- file("C:/Temp/all.Rout", open = "wt")
sink(zz)
sink(zz, type = "message")
try(log("a"))
## back to the console
sink(type = "message")
sink()
unlink("C:/Temp/all.Rout")
But the error per
Hi Henrik, Jim, Sarah, Duncan,
Hi All,
I have tried the built-in solution using PowerShell:
$lockedFile="C:\Windows\System32\wshtcpip.dll"
Get-Process | foreach{$processVar = $_;$_.Modules | foreach{if($_.FileName
-eq $lockedFile){$processVar.Name + " PID:" + $processVar.id}}}
It did not show
Hi Martin,
many thanks for following-up on my question.
I did it again:
## capture all the output to a file.
zz <- file("C:/Temp/all.Rout", open = "wt")
sink(zz)
sink(zz, type = "message")
try(log("a"))
## back to the console
sink(type = "message")
sink()
close(zz)
This works.
I tried several
Hi All,
I have a bunch of dichotomous code variables which shall be plotted in one
graph using one of their values, this is "1" in this case.
The dataset looks like this:
-- cut --
var1 <- c(1,0,1,0,0,1,1,1,0,1)
var2 <- c(0,1,1,1,1,0,0,0,0,0)
var3 <- c(1,1,1,1,1,1,1,1,0,1)
ds <- data.frame(var
Hi Bob,
Hi John,
Hi readers,
many thanks for your reply.
I did
barplot(colSums(dataset %>% select(FirstVar:LastVar)))
and it worked fine.
How would I do it with ggplot2?
Kind regards
Georg
Von:"Fox, John"
An: "g.maub...@weinwolf.de" ,
Kopie: "r-help@r-project.org"
Datum: 05.
Hi All,
I began to document my functions using roxygen2. This is an example of a
function I would like to write for training and testing purposes:
t_simple_table <- function(variable,
useNA = TRUE,
print = FALSE) {
#' @title Create a simp
Hi All,
in my R programs I use different libraries to work with Excel sheets, i.
e. xlsx, excel.link.
When running chunks of code repeatedly and not always in the order the
program should run for development purposes I ran into trouble. There were
conflicts between the methods within these fun
Hi Duncan,
many thanks for your reply.
Your suggestion of using requireNamespace() together with explicit
namespace calling using the "::" operator is what I was looking for:
-- cut --
f_test <- function() {
requireNamespace("openxlsx")
cat("Loaded packages AFTER loading library")
Von:Duncan Murdoch
An: g.maub...@weinwolf.de, r-help@r-project.org,
Datum: 13.10.2016 12:34
Betreff:Re: Antwort: Re: [R] Visibility of libraries called from
within functions
On 13/10/2016 6:21 AM, g.maub...@weinwolf.de wrote:
> Hi Duncan,
>
> many thanks for your reply.
>
> Y
Hi All,
I need to reshape an ESRI shape file: http://arnulf.us/PLZ and resp
http://www.metaspatial.net/download/plz.tar.gz
I found an instruction for T-SQL Server:
https://blog.oraylis.de/2010/05/german-map-spatial-data-for-plz-postal-code-regions/
How can I do this using R?
Kind regards
Geo
Hi All,
I would like to store a long string with white space in a variable:
-- cut --
# Create README.md
readme <- "---
title: "Your project title here"
author: "Author(s) name(s) here"
date: "Current date here"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo
Hi All,
when using
-- cut --
number_style <- openxlsx::createStyle(
numFmt = "COMMA"
)
openxlsx::addStyle(
wb = xlsx_workbook,
sheet = "Kundenliste",
style = number_style,
rows = 2:nrow(customer_list),
cols = 4:5
)
--cut --
I get the error
Hi All,
I build an empty dataframe to fill it will values later. I did the
following:
-- cut --
matrix(NA, 2, 2)
[,1] [,2]
[1,] NA NA
[2,] NA NA
> data.frame(matrix(NA, 2, 2))
X1 X2
1 NA NA
2 NA NA
> as.data.frame(matrix(NA, 2, 2))
V1 V2
1 NA NA
2 NA NA
-- cut --
Why does data.
Hi All,
I need to execute a loop on variables to compute several KPIs.
Unfortunately the for loop is executed only once for the last KPI given.
The code below illustrates my current solution but is not completely
necessary to spot the problem. I just give an idea what I am doing
overall. Looks
Hi Ulrik,
oh no! What a mistake did I make. But I definitely did not see the
failure.
Many thanks for helping me.
Kind regards
Georg
Von:Ulrik Stervbo
An: g.maub...@weinwolf.de, r-help@r-project.org,
Datum: 17.11.2016 12:24
Betreff:Re: [R] for loop is looping only once
Hi All,
Dear Readers,
I am using openxlsx to export data to Microsoft Excel 2013, 32-Bit, German
Version:
--- schnipp ---
library("openxlsx")
dataset <- structure(
list(
a = c(1126039.81, 45636.44, 14847.41),
b = c(1194447.5,
88310.53, 18699.68),
c = c(1560307.73, 34203
1 - 100 of 120 matches
Mail list logo