我有OpenSSL(0.9.8 iirc),因此我决定在第一次使用该库之前先对其进行更新。下载version 1.1.1d后,我执行了基本例程:
library(readr)
library(tidyr)
library(purrr)
library(rlang)
library(glue)
library(dplyr)
library(miscTools)
library(matrixStats)
library(shiny)
library(reshape2)
library(dplyr)
hotdrinks<-list("tea","green tea")
juices<-list("orange","mango")
energydrinks<-list("powerhorse","redbull")
drinks<-list("hotdrinks"=hotdrinks,"juices"=juices,"energydrinks"=energydrinks)
biscuits<-list("loacker","tuc")
choc<-list("aftereight","lindt")
gum<-list("trident","clortes")
sweets<-list("gum"=gum,"biscuits"=biscuits,"choc"=choc)
all_products<-list("sweets"=sweets,"drinks"=drinks)
mt<-melt(all_products)
mt2<-mt%>%mutate("Price"=c(23,34,23,23,54,32,45,23,12,56,76,43),
"Quantity"=c(10,20,26,22,51,52,45,23,12,56,76,43),
"amount"=c(23,34,23,23,54,32,45,23,12,56,76,43))
t1<-mt2[,c(4,3,1,5,6,7)]
t1
colnames(t1)<-c("CAT","PN","SP","Quantity","Price","amount")
t2<-list(unique(t1$CAT))
t2
QL<-c("Quantity","Price")
QD<-c("Quantity","amount")
QS<-c("amount","Price")
all <- list("drinks"=drinks, "sweets"=sweets)
FCX<-data.frame("sbo"=c("w","q","a"),
"Quantity_fcx"=c(3,2,5),
"Price_fcx"=c(7,8,5),
"amount_fcx"=c(4,7,3)
)
#DF1<-Y
DF1 <- t1
DF1
#print(DF1)
DFCXL<-list(colnames(DF1[-c(1:3)]))
DFCXL
DFCX1<-lapply(DFCXL, paste0, "_fcx")
DFCX1
DFCXM<-colMeans(FCX[,unlist(DFCX1)],na.rm = FALSE)
DFCXM
DFCXMd<-colMedians(data.matrix(FCX[,unlist(DFCX1)]),na.rm = FALSE )
DFCXMddf<-as.data.frame(t(DFCXMd))
DFCXMddf
DFCX1l<-as.list(DFCX1)
colnames(DFCXMddf)<-unlist(DFCX1l)
DFCXMddf
#median repeated tibble
rDFCXMddf<-DFCXMddf[rep(seq_len(nrow(DFCXMddf)), each = nrow(DF1)), ]
rDFCXMddf
DFCX<-data.frame(t(DFCXM))
DFL<-as.vector(colnames(DF1))
DFL
DFCX
#mean repeated tibble
rDFCX<-DFCX[rep(seq_len(nrow(DFCX)), each = nrow(DF1)), ]
#rDFCX
#ascending rank form smallest to largest where the smallest is the most competitive
Asclist1<-list("Quantity","Price","amount")
#Asclist1
#descending rank form largest to smallest where the largest is the most competitive
Deslist2<-list("xyz")
#Deslist2
#DF3 contains orginal dataframe with rank for each column descending & ascending
DF3<-
DF1 %>% mutate_if(grepl(paste(Deslist2, collapse = "|"), names(.)), list(rank=~rank(-.))) %>%
mutate_if(grepl(paste(Asclist1, collapse = "|"), names(.)), list(rank=~rank( .)))
DF3
#DF4 contains only determinants columns
DF4<-DF3%>%select(-one_of(DFL))
DF4
#DF5 contains all deterements with their ranks columns
DF5<-cbind(rDFCX,DF4)
DF5
#getting final rank for each column based on multiplying CX columns "weight" * normal rank to get weighted ranking
dynamic_mutate = function(DF5,
col_names = gsub("(.*)_\\w+$", "\\1", names(DF5)),
expression = "({x}_rank*{x}_fcx)",
prefix = "FINAL"){
name_list = col_names %>% unique() %>% as.list()
expr_list = name_list %>% lapply(function(x) parse_quosure(glue(expression))) %>%
setNames(paste(prefix, name_list, sep = "_"))
DF5 %>% mutate(!!!expr_list)}
DF6<-DF5 %>% dynamic_mutate()
#DF6
#getting mean for ranks
DFL2<-as.vector(colnames(DF5))
DF7<-DF6%>%select(-one_of(DFL2))
#DF7
#final limit ranking
DF8<-mutate(DF7,fnl_scr=rowMeans(DF7))
#DF8
#final rank
Ranking<-rank(DF8$fnl_scr)
#Ranking
#final dataframe
DF9<-as_tibble(cbind(DF1,Ranking))
DF9
后来,我遇到了一些问题,但是在做
$ ./config
$ make
$ make test
$ sudo make install
和
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
here和here所提及的似乎已经解决了其预期的问题。 经过进一步测试,我什么时候做
xcode-select --install
然后:
//File: "sock.cpp"
#include <openssl/ssl.h>
#include <openssl/err.h>
int main()
{
SSL_library_init();
return 0;
}
我得到以下人的完整答复:
g++ sock.cpp
我完全不确定如何解决此错误。
OS X EL Capitan v10.11.5
编辑:我认为我的问题与this one不同,因为似乎没有相同的解决方案。 做
Undefined symbols for architecture x86_64:
"_OPENSSL_init_ssl", referenced from:
_main in sock-9253e0.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
给出相同的错误输出。